Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
Currently I'm working in an assembly with only flat plates (as sheet metal parts). All SM parts are engraved on the bottom side which means all Flat patterns should be faced towards the side with engraving. This so the export to DXF is always correctly. At this moment the engraving is constantly at the wrong side for every plate so I want to Flip the FP Oriëntations, from the assembly, at once. Can somebody help me with this?
I already found the code from below. It should be something like this but the rule has to be runned from the upper assembly (and not from the part itself).
'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
Solved! Go to Solution.