Autodesk Inventor
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
ILogic rule for modeling/s heet metal state
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hellow,
Deos anyone know how what is the iLogic rule for identifying if a part is in a "modeling" state or "sheet metal" state?
Regards,
Shai
Re: ILogic rule for modeling/s heet metal state
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi shaiadle,
You can use a conditional such as this to check for the existence of a flat pattern:
If oSMDef.FlatPattern Is Nothing Then
Here's a quick example:
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'tell the user there is no flat pattern
MessageBox.Show("This file has no flat pattern", "iLogic")
Else
'tell the user there is a flat pattern
MessageBox.Show("This file does have a flat pattern", "iLogic")
end if
but to answer your question more directly, you can use the FlatPattern.ExitEdit method to return to the folded model, if the model is in the Flat Pattern environment:
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oDoc.ComponentDefinition
oSMDef.FlatPattern.ExitEdit
and conversly you can use the FlatPattern.Edit method to return to the flat pattern, if the model is in the folded environment:
Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim oSMDef As SheetMetalComponentDefinition oSMDef = oDoc.ComponentDefinition oSMDef.FlatPattern.Edit
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
Re: ILogic rule for modeling/s heet metal state
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
If you're just trying to determine if the active document is a sheet metal part versus standard part this code may help.
Dim curDoc = ThisApplication.ActiveDocument
If curDoc.DocumentType = kPartDocumentObject Then
'This is a Part Drawing
If curDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
'This is a SheetMetal Part
MessageBox.Show("This is a sheet metal part.", "SMCheck")
Else
MessageBox.Show("This is a standard part.", "SMCheck")
End If
End If
Design Engineer / Programmer
A & A Manufacturing
Support a Q & A For CAD Users: Stack Exchange Proposal
Re: ILogic rule for modeling/s heet metal state
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks Rodney,
Is there a help resource where I can find the "text" for all the Sub-Types of files.
I am trying to output them on the immediate window, but it seems to give me a troubles (or maybe I dont know how to get imformation on the Immediate window yet)
Regards,
Wajih

