Inventor General

Reply
Member
shaiadle
Posts: 5
Registered: ‎05-05-2010
Message 1 of 6 (873 Views)

ILogic rule for modeling/sheet metal state

873 Views, 5 Replies
10-06-2011 12:41 AM

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

*Expert Elite*
Curtis_Waguespack
Posts: 2,780
Registered: ‎03-08-2006
Message 2 of 6 (855 Views)

Re: ILogic rule for modeling/sheet metal state

10-06-2011 09:42 AM in reply to: shaiadle

 

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

 

 

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Valued Mentor
rjay75
Posts: 292
Registered: ‎04-14-2005
Message 3 of 6 (843 Views)

Re: ILogic rule for modeling/sheet metal state

10-06-2011 10:45 AM in reply to: shaiadle

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

 

Active Contributor
WHassan
Posts: 32
Registered: ‎07-17-2012
Message 4 of 6 (505 Views)

Re: ILogic rule for modeling/sheet metal state

09-10-2012 02:24 PM in reply to: rjay75

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

 

 

Valued Mentor
niksasa
Posts: 293
Registered: ‎12-28-2012
Message 5 of 6 (239 Views)

Re: ILogic rule for modeling/sheet metal state

10-08-2013 11:33 AM in reply to: Curtis_Waguespack

Curtis_Waguespack написано:

 

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

 I have this code does not work in ilogic

 

 

 


 

САПР - это инструмент, но только при условии грамотного подхода.
*Expert Elite*
Curtis_Waguespack
Posts: 2,780
Registered: ‎03-08-2006
Message 6 of 6 (235 Views)

Re: ILogic rule for modeling/sheet metal state

10-08-2013 11:35 AM in reply to: niksasa

Hi niksasa,

 

If you are using Inventor 2014, then this might be related to this problem:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Subtype-Sheet-Metal-file-changed-in-In...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube