Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save autokludge/e8c3ca945d1eec441aff0a2da65a7b53 to your computer and use it in GitHub Desktop.
Save autokludge/e8c3ca945d1eec441aff0a2da65a7b53 to your computer and use it in GitHub Desktop.
Inventor ilogic - test drawing line type
' Set a reference to the active document
Dim oDoc As Document = ThisDoc.Document
Dim oSelectSet As SelectSet = oDoc.SelectSet
'Are things selected?
If oSelectSet.Count < 1 Then
MsgBox("Select drawing line first", MsgBoxStyle.OkOnly, "Error")
Return
End If
If oSelectSet.Count > 1 Then
MsgBox("Only showing info for 1st selected item.", MsgBoxStyle.OkOnly, "Alert")
End If
For Each selection As Object In oSelectSet
Dim selType As ObjectTypeEnum = CType(selection.Type, ObjectTypeEnum)
If TypeOf selection Is DrawingCurveSegment Then
Dim dcs As DrawingCurveSegment = selection
MsgBox("Selected Curve - " & dcs.GeometryType.ToString, MsgBoxStyle.OkOnly, "Selected Curve")
Else
MsgBox("Selected - " & selType.ToString, MsgBoxStyle.OkOnly, "Selected Object")
End If
return
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment