How to rename the workplanes using ilogic for features created in flat pattern

How to rename the workplanes using ilogic for features created in flat pattern

Anonymous
Not applicable
906 Views
3 Replies
Message 1 of 4

How to rename the workplanes using ilogic for features created in flat pattern

Anonymous
Not applicable

Hello,

I used below code for renaming work planes in Sheet metal flatpattern tree but it renaming in model tree but not in flatpattern tree.

Can anyone help me to rename the planes in flatpattern tree?

SyntaxEditor Code Snippet

'Rename work planes
oDoc = ThisApplication.activedocument
i = 1
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
    If oWorkPlane.IsCoordinateSystemElement = False Then 
    oWorkPlane.Name = "WorkPlane" & i
    i=i+1
    End If
Next

 

0 Likes
Accepted solutions (1)
907 Views
3 Replies
Replies (3)
Message 2 of 4

t_hascj
Autodesk
Autodesk
Accepted solution

Hi,

If you want to edit workplanes in flat pattern, you need flat pattern object. Try this code.
SyntaxEditor Code Snippet

'Rename work planes
oDoc = ThisApplication.ActiveDocument

Dim oCompDef As SheetMetalComponentDefinition
oCompDef = oDoc.ComponentDefinition

i = 1
For Each oWorkPlane In oCompDef.WorkPlanes
    If oWorkPlane.IsCoordinateSystemElement = False Then 
    oWorkPlane.Name = "WorkPlane" & i
    i=i+1
    End If
Next

i = 1
For Each oWorkPlane In oCompDef.FlatPattern.WorkPlanes
    If oWorkPlane.IsCoordinateSystemElement = False Then 
    oWorkPlane.Name = "WorkPlane" & i
    i=i+1
    End If
Next


Thanks,
Jaroslav

Message 3 of 4

Anonymous
Not applicable

Hello Jaroslav,

 

Thank you its working fine.

 

I have a doubt, is it possible to create Workplanes to Origin in Flatpattern model tree using iLogic?

 

0 Likes
Message 4 of 4

t_hascj
Autodesk
Autodesk

I think it is possible, but you need more inputs. Not only origin. Look at this documentation about Workplanes. There is some create methods.

0 Likes