お粗末ですが私の作ったコードを貼っておきます。VB6なので最近の環境で動作するか疑問ですが..(汗
処理の流れは、図上に書かれた要素を選択させてスプラインなどの曲線かを判定しています。グループ化された要素の中に曲線があるかの判定もしています。
やっていることはhGndさんの解説そのまんまです。
Set Doc = Nothing
Set Doc = App.GetDoc ‘現在読込まれている図面を取得する。
Dim gpos As Long, gcount As Long, flg As Boolean
App.setmessage “曲線を指定して下さい。”
lpos = Doc.gettouchprimitive
If Doc.getkind(lpos) = 64 Then
henkei2
Else
If Doc.getkind(lpos) = 1024 Then
gpos = lpos
gcount = Doc.getgroupcount(gpos)
lpos = Doc.getgroupheadposition(gpos)
Do
If Doc.getkind(lpos) = 64 Then
henkei2
flg = True
Exit Do
Else
lpos = Doc.getgroupnextposition(gpos)
End If
Loop While lpos Doc.getgrouptailposition(gpos)
If flg = False Then MsgBox “曲線ではありません。”
Else
MsgBox “曲線ではありません。”
End If
End If