Programmically selecting Face for unfold

Programmically selecting Face for unfold

Anonymous
Not applicable
329 Views
2 Replies
Message 1 of 3

Programmically selecting Face for unfold

Anonymous
Not applicable
I am currently locating a face by using the planarentity property from a Planarsketch obect.

I then use the Selectset.Select method to select the face before I use the sheetmetalcomponentdefinition.unfold() method.

It doesn't seem to give me the same flat pattern as when I manually select the face before and unfold.

(Usually the reverse face is generated.)

Am I doing something wrong?

[code]
Set oFace = oSketch.PlanarEntity
Call oSelectSet.Clear
Call oSelectSet.Select(oFace)
oComp.Unfold
[/code]

Thanks,

~Tom
0 Likes
330 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Tom,

The API unfold method does not use the selected face at all. Unfortunately,
there currently isn't a way to specify the 'top' face during unfolding via
the API. This is a known limitation that we intend to address in a future
release.

The workaround is to drive the user interface command thru the API. So
select the face as you are currently doing and run the flat pattern command
as follows:

Sub Unfold()
Dim odef As ControlDefinition
Set odef =
ThisApplication.CommandManager.ControlDefinitions("SheetMetalFlatPatternCmd")

odef.Execute
End Sub

Sanjay-

wrote in message news:5239310@discussion.autodesk.com...
I am currently locating a face by using the planarentity property from a
Planarsketch obect.

I then use the Selectset.Select method to select the face before I use the
sheetmetalcomponentdefinition.unfold() method.

It doesn't seem to give me the same flat pattern as when I manually select
the face before and unfold.

(Usually the reverse face is generated.)

Am I doing something wrong?

[code]
Set oFace = oSketch.PlanarEntity
Call oSelectSet.Clear
Call oSelectSet.Select(oFace)
oComp.Unfold
[/code]

Thanks,

~Tom
0 Likes
Message 3 of 3

Anonymous
Not applicable
Thank you Sanjay,

That did the trick.
0 Likes