Offset each segments boundary in PowerMILL 2015

Offset each segments boundary in PowerMILL 2015

hx
Advocate Advocate
1,580 Views
3 Replies
Message 1 of 4

Offset each segments boundary in PowerMILL 2015

hx
Advocate
Advocate

At PowerMILL 2015.

 

I Wrote an macro file to offset each segments boundary for 2 mm.

 

The macor commands are:

 

 

STRING $Active_Boundary = Boundary.Name
INT $NO_OF_SEGMENTS = SEGMENTS(Boundary)

INT $Select_Segment = 0

DO {

EDIT BOUNDARY ; DESELECT ALL
EDIT BOUNDARY ; SELECT $Select_Segment
EDIT BOUNDARY ; CURVEEDITOR START
CURVEEDITOR MODE OFFSET
MODE TRANSFORM OFFSET DISTANCE 2
CURVEEDITOR FINISH ACCEPT
EDIT BOUNDARY ; DESELECT ALL

$Select_Segment = $Select_Segment+1

} WHILE $Select_Segment < $NO_OF_SEGMENTS

But when I run the macro file, the problem is not do loop for each segments boundary. only two esgments. just like the image show.

 

2016-11-21_16-50-46.png

 

when the $Select_Segment > 2 , the selected one is the arrow points to the line segment.

How can I fixed this macro?

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

hx
Advocate
Advocate

Upload the project files and macro.

Message 3 of 4

kukelyk
Advisor
Advisor
Accepted solution

Try this:

STRING $Active_Boundary = Boundary.Name
INT $NO_OF_SEGMENTS = SEGMENTS(Boundary)
INT $Select_Segment = 0
EDIT BOUNDARY ; CURVEEDITOR START
DO {
EDIT BOUNDARY ; DESELECT ALL
EDIT BOUNDARY ; SELECT 0

CURVEEDITOR MODE OFFSET
MODE TRANSFORM OFFSET DISTANCE 2
EDIT BOUNDARY ; DESELECT ALL 

$Select_Segment = $Select_Segment+1
} WHILE $Select_Segment < $NO_OF_SEGMENTS
CURVEEDITOR FINISH ACCEPT

The new offset curve will be the last..

 

 

Message 4 of 4

hx
Advocate
Advocate

Perfect. thanks.

0 Likes