Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Determine if drawing is from part or sheetmetal

Rob67ert
Collaborator

Determine if drawing is from part or sheetmetal

Rob67ert
Collaborator
Collaborator

Hi,

 

I like to determine with iLogic if the drawing of an .ipt is from a part or a sheetmetal.

How can i do that?

Robert

If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
0 Likes
Reply
Accepted solutions (1)
477 Views
3 Replies
Replies (3)

Owner2229
Advisor
Advisor
Accepted solution

Hey, here you go:

 

' Define the open document
Dim aDoc As Document = ThisApplication.ActiveDocument
If aDoc Is Nothing Then Exit Sub
' Look at all of the files referenced in the open document
For Each oDoc As Inventor.Document In aDoc.AllReferencedDocuments
	Dim FName As String = oDoc.FullFileName
	If oDoc.DocumentSubType.DocumentSubTypeID = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
		MsgBox(FName & vbnewline & "is a sheetmetal part.")
	ElseIf oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
		MsgBox(FName & vbnewline & "is a normal part.")
	End If
Next

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods

Rob67ert
Collaborator
Collaborator

@Owner2229 Thanks :slightly_smiling_face:

Robert

If you find this reply helpful ? It would be nice if you use the Accept as Solution or Kudos button below.
0 Likes

Owner2229
Advisor
Advisor

You're welcomed. Smiley Happy

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes