Macro Punch Problem

Hello

 

I am stuck when executing my macro when I start the execution step by step at the time of the 3rd line for a value of A of 1.2 the line returns to the origin without understanding why.

For me the coordinates are good, I don't see where it can be a problem.

If anyone has an idea

 

Kind regards


macro1.swp

Cancelled and replaced


macro1.swp

Hello

probable problem with the decimal separator between the . and the ,

It is best to do a conversion test of your text into duplicate and if you receive an error then you change the decimal separator of your text and continue your macro ...

Kind regards

1 Like

Thank you for your answer,

 

No, the problem is not in the entry of a comma value but in the realization of the macro,

The macro will, depending on the values entered, create a sketch and then draw lines in order to execute a revolution. but for a low value of A, i.e. 1 or 2, a line returns to the origin in Y.

I invite you to try the macro in step mode

 

Kind regards

Hello

misunderstanding on my part, it comes from the automatic snapping that takes over, zoom in tightly during the execution of your macro by adding for example the line:

boolstatus = Part.ViewZoomTo2(0, 0, 0, 0.001, 0.001, 0)

before the line

Set skSegment = Part.SketchManager.CreateCenterLine(0#, -300 / 1000, 0#, 0#, 300 / 1000, 0#)

Kind regards

3 Likes

It's perfect now no more problem