Visual LISP, AutoLISP and General Customization

## Visual LISP, AutoLISP and General Customization

Contributor
Posts: 20
Registered: ‎08-30-2012
Message 11 of 15 (329 Views)

# Re: LISP to find Position XYZ and Rotation XYZ of each entity?

10-08-2012 03:10 PM in reply to: davetyner

For simple 2D objects like circles and text, the information is stored in the 210 code for the rotation of the z axis. For solids, the entire geiometry seems to be encoded with a series of 1 codes. The Help says it proprietary, so AutoDesk might not want you to know about that.

*Expert Elite*
Posts: 4,804
Registered: ‎09-13-2004
Message 12 of 15 (299 Views)

# Re: LISP to find Position XYZ and Rotation XYZ of each entity?

10-10-2012 07:31 AM in reply to: anim8er3

anim8er3 wrote:

For simple 2D objects like circles and text, the information is stored in the 210 code for the rotation of the z axis. ....

This thread may be dead after more than a year [davetyner, are you still out there?], but just in case....

I'm not at all sure that the extrusion direction is what they're looking for.  Message 5 [if you have them chronologically] suggests to me that maybe they're looking for a rotation for Text/Mtext as an XYZ vector rather than as an angle in radians in the drawing plane of the object.  So, for instance, for a piece of Text that's in the WCS plane, with a rotation angle of 0, the (assoc 210) extrusion direction would be 0,0,1, but I think the rotational vector they're looking for would be [if they want a unit vector] 1,0,0.  After all, whatever the (assoc 50) rotation is for Text in the WCS, the (assoc 210) extrusion direction would be the same, whereas the rotational vector [if what they mean for ordinary left-justified Text is the direction from the insertion point along the baseline] would vary with the rotation -- 1,0,0 for 0 degrees, 0,1,0 for 90 degrees, etc.

I'm hoping for some elaboration from the OP about whether that's what they're after, and particularly in answer to the question at the beginning of my first reply.

Kent Cooper
Contributor
Posts: 20
Registered: ‎08-30-2012
Message 13 of 15 (294 Views)

# Re: LISP to find Position XYZ and Rotation XYZ of each entity?

10-10-2012 07:53 AM in reply to: Kent1Cooper

Kent, I mispoke if it sounded as if the 210 code was a direct rotational value, as in degrees or radians. It's a vector based on diistances in each X,Y,Z direction from 0,0,0 that would result in a line with a length of 1 at the rotational angle. It's been a few years since I was doing 3D modeling on a regular basis, but a subject I was interested in knowing a little more about. As much as possible I use entmake and other DXF code manipulation to crete/modify object in AutoCAD. Knowing how to do it for 3D work would be handy to know. I see no easy answers for working with solids, but simple 2D objects are simple enough to work with that way.Besides, I'm waiting for a new project to start and I was bored.

Mentor
Posts: 1,677
Registered: ‎03-14-2004
Message 14 of 15 (278 Views)

# Re: LISP to find Position XYZ and Rotation XYZ of each entity?

10-10-2012 08:46 PM in reply to: anim8er3

It give nil for a 3DSOLID

`(cdr (assoc 210 (entget(car (entsel)))))`

Contributor
Posts: 20
Registered: ‎08-30-2012
Message 15 of 15 (268 Views)

# Re: LISP to find Position XYZ and Rotation XYZ of each entity?

10-11-2012 05:53 AM in reply to: devitg

It give nil for a 3DSOLID

Exactly. They are doing something completely different for 3D solids. The 210 code is for text, circles and other simple objects. A 3D solid has not 210 code at all. Instead, is has numberous 1 codes with proprietary data.

Recently Solved