Determine if drawing is from part or sheetmetal

Determine if drawing is from part or sheetmetal

Rob67ert
Collaborator Collaborator
529 Views
3 Replies
Message 1 of 4

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
Accepted solutions (1)
530 Views
3 Replies
Replies (3)
Message 2 of 4

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
Message 3 of 4

Rob67ert
Collaborator
Collaborator

@Owner2229 Thanks 🙂

Robert

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

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