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

Determine if drawing is from part or sheetmetal

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.
Owner2229
in reply to: Rob67ert

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
in reply to: Owner2229

@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.
Owner2229
in reply to: Rob67ert

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