Inventor Customization

Inventor Customization

Reply
Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 1 of 3 (1,156 Views)
Accepted Solution

Sheet Metal Part Orientation and Flat Pattern Views to Correspond in Space

1156 Views, 2 Replies
04-17-2012 12:04 PM

Hello All,

 

I have a bit of an issue here. I am trying to program the view placement of various parts and have run into a situation where I need to place flat patterns. On the programming side there isn't an issue, but the issue occurs when attempting to select the wanted view orientattion.

 

Attached you will find 2 screen shots. One of them is from the "Folded Model" (Take note of the View Cube)

 

The other is from only Pressing the "Go to Flat Pattern" Button and being in "Flat Pattern" viewing mode (Note the Cube)

 

I need the Flat Pattern View to correspond with the Orientation of the Folded Model.

 

Any help is welcome as quickly as possible

 

Thanks

Mitch

Hi mhatfield,

 

Since this is posted on the Customization forum here are 3 quick iLogic rules (and a sample part file)  to do this as well.

 

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

http://inventortrenches.blogspot.com/2011/05/edit-flat-pattern-orientation.html

 

 

 

'Flip Base Face
' Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
oSMDef.FlatPattern.Edit
end if

'flip the flat pattern base face
oSMDef.FlatPattern.FlipBaseFace

'zoom all
ThisApplication.ActiveView.Fit

 

 

'Flip Alignment Type
' Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
end if

'define alignment parameters
Dim oAlignmentType as AlignmentTypeEnum
Dim oAlignedTo as Object
Dim oAlignmentDirection as Boolean

'get current alignment parameters
oSMDef.FlatPattern.GetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'toggle alignment horizontal/ vertical parameter
'kHorizontalAlignment = 64257
'kVerticalAlignment = 64258
if oAlignmentType = 64257 then
oAlignmentType = 64258
else
oAlignmentType = 64257
end if
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'zoom all
ThisApplication.ActiveView.Fit

 

 

'Reverse Alignment Direction
'Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
end if


'define alignment parameters
Dim oAlignmentType as AlignmentTypeEnum
Dim oAlignedTo as Object
Dim oAlignmentDirection as Boolean


'get current alignment parameters
oSMDef.FlatPattern.GetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'toggle alignment reverse direction parameter
if oAlignmentDirection = True then
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, False)
else
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, True)
end if

'zoom all
ThisApplication.ActiveView.Fit

 

Mentor
mehatfie
Posts: 163
Registered: ‎02-10-2012
Message 2 of 3 (1,147 Views)

Re: Sheet Metal Part Orientation and Flat Pattern Views to Correspond in Space

04-17-2012 01:53 PM in reply to: mehatfie

For anybody interested,

 

The Solution was found by entering the Flat Pattern Environment  >  Right Clicking on "Flat Pattern" in the Model Browser  >  "Edit Flat Pattern Definition"

 

This gives you a set of tools to realign the view to your liking

 

Information found at this link:

http://wikihelp.autodesk.com/enu?adskContextId=TOOLTIP_SHEETMETALFLATPATTERNCMD&language=ENU&release...

 

Mitch

*Expert Elite*
Curtis_Waguespack
Posts: 2,934
Registered: ‎03-08-2006
Message 3 of 3 (1,142 Views)

Re: Sheet Metal Part Orientation and Flat Pattern Views to Correspond in Space

04-17-2012 02:38 PM in reply to: mehatfie

Hi mhatfield,

 

Since this is posted on the Customization forum here are 3 quick iLogic rules (and a sample part file)  to do this as well.

 

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

http://inventortrenches.blogspot.com/2011/05/edit-flat-pattern-orientation.html

 

 

 

'Flip Base Face
' Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
oSMDef.FlatPattern.Edit
end if

'flip the flat pattern base face
oSMDef.FlatPattern.FlipBaseFace

'zoom all
ThisApplication.ActiveView.Fit

 

 

'Flip Alignment Type
' Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
end if

'define alignment parameters
Dim oAlignmentType as AlignmentTypeEnum
Dim oAlignedTo as Object
Dim oAlignmentDirection as Boolean

'get current alignment parameters
oSMDef.FlatPattern.GetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'toggle alignment horizontal/ vertical parameter
'kHorizontalAlignment = 64257
'kVerticalAlignment = 64258
if oAlignmentType = 64257 then
oAlignmentType = 64258
else
oAlignmentType = 64257
end if
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'zoom all
ThisApplication.ActiveView.Fit

 

 

'Reverse Alignment Direction
'Set a reference to the active document.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

'ensure this part has a flat pattern
Dim oSMDef As SheetMetalComponentDefinition
oSMDef = oPartDoc.ComponentDefinition
If oSMDef.FlatPattern Is Nothing Then
'create flat pattern
oSMDef.Unfold
Else
end if


'define alignment parameters
Dim oAlignmentType as AlignmentTypeEnum
Dim oAlignedTo as Object
Dim oAlignmentDirection as Boolean


'get current alignment parameters
oSMDef.FlatPattern.GetAlignment(oAlignmentType, oAlignedTo, oAlignmentDirection)

'toggle alignment reverse direction parameter
if oAlignmentDirection = True then
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, False)
else
oSMDef.FlatPattern.SetAlignment(oAlignmentType, oAlignedTo, True)
end if

'zoom all
ThisApplication.ActiveView.Fit

 



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





Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.