DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Query Ent_Point trouble

Started by Mark Laing, May 26, 2010, 06:19:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mark Laing

The trouble is it won't work in version 20.
It did in version 17
I'm trying to set a line, get the coordinates of the one end of it, and use them to set a pull-out at the end of the line.
My macros 17 help file doesn't seem to work on my windows 7 machine.

So my question is, how do I make it work.?



Sys(242)= 1 'Select object when created [0=no, 1=yes]
>Line
{
<Pointxyz [x1, y1, z1]
<PointPolar [dist, ang, 0]
}
getselect 1, entnum
entity entnum
query ent_type, e
'message "entity type = ", e
Query Ent_Point, 2, ptX, ptY, ptZ


Dempsey

#1
I got it working as follows:

INCLUDE "DcadAlias.d3i"
Sys(242)= 1 'Select object when created [0=no, 1=yes]
>Line
{
<Pointxyz [10, 20, 5]
<PointPolar [30, 45, 0]
}
getselect 1, entnum
entity entnum
query ent_type, e
Query Ent_Point, 2, ptX, ptY, ptZ
message "entity=", entnum, "entity type=", e, "results=", ptX, ptY, ptZ
end


The include is needed to define ent_type and ent_point.
Dempsey

Mark Laing

Thanks Dempsey that was it.
I had gotten in trouble with the include thing just a few posts back, and commented it out of the code for this macro.
Removed the comment symbol, removed the path, and it worked.
Thanks
Mark

DrollTroll

25 years with DesignCAD