Macros Select Point in a sub option of the command

Hi,

I am using OrientOnCrv command in a macro.
When command asks to select a point as a base point, I want to select it by using macro e.g. SelName.
The point is selected but the the OrientOnCrv does not recognize this selection and still asks to select a point.

Question: how to properly select a point in this mactor?

My current macro is:

!_SelNone
_-SelName "chair" 
_OrientOnCrv
_-SelName "chair_origin"

It only works if I type coordinates of a point not the name of the object:

!_SelNone
_-SelName "chair" 
_OrientOnCrv
0,0,0

Test.3dm (180.1 KB)

1 Like

Not sure you can actually do that in a macro - there is EvaluatePt, which returns the coordinates of a point object but as it returns both world and CPlane coordinates on the command line I don’t think it will work for that. Otherwise I don’t know of a way to get the coordinates without a script.

2 Likes

The EvaluatePt returns a string with a lot of text:
Point in world coordinates = 1566.000,-488.000,0.000 CPlane coordinates = 1566.000,-488.000,0.000

I guess there is no string operations in macros to get the coordinates?

mmm… it might seem so but I wonder why in the case of the command _OrientOnCrv the selected point cannot be fed to the command. On the other hand if you try something like this:

!_SelNone 

_-SelName "chair"
_ArrayPolar

_-SelName "table_center"
_Enter

It does take the point as input but it consider it as the origin (0,0,0)… Am I missing something here?

1 Like

No, not really. Just appears to work because “table_center” happens to be at 0,0,0. Try moving the whole thing away from 0 and then running the macro. It will ArrrayPolar around 0 still, not table_center. You can see below it is not accepted as the center, so the macro moves on to the next “Enter” and that is accepted as having chosen the CPlane origin as the center.

Command: _SelNone
Command: _-SelName
Object name to select ( Select ): "chair"
1 block instance added to selection.
Command: _ArrayPolar
Center of polar array. Press Enter to use the CPlane origin ( Axis ): _-SelName
Object name to select ( Select ): "table_center"
No objects added to selection.
Center of polar array. Press Enter to use the CPlane origin ( Axis ): _Enter
Center of polar array. Press Enter to use the CPlane origin ( Axis )
Angle to fill or first reference point <360> ( Preview=Yes  StepAngle  Rotate=Yes  ZOffset=0 )
Press Enter to accept. FillAngle = 360 ( Items=3  FillAngle  Rotate=Yes  ZOffset=0 )

Indeed, you are right. I suppose that’s it. Thanks a lot!

Not that I know of, no.

1 Like