Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mehatfie
4094 Views, 2 Replies

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

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

2 REPLIES 2
Message 2 of 3
mehatfie
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

Message 3 of 3

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report