Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

WCS coordinates from an objekt in a 3D rotated block

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
tidl_var_dette_min_gamle_email
216 Views, 4 Replies

WCS coordinates from an objekt in a 3D rotated block

I would like to use AutoLISP to extract coordinates from a rectangle (in a block) that are rotated in 3d. but how?
4 REPLIES 4
Message 2 of 5

Just some starting questions....

 

Looking at how a routine might identify the rectangle if it's in a Block, before even considering how to pull coordinates from it:

Is the rectangle a single object?  Presumably a Polyline?  Or is it made up of four Lines?  A Block itself?  A 2D Solid, or 3DFace?

Whatever it is [or they are], are there other objects of the same kind in the Block?  If so, are there characteristics of the rectangle by which it can be distinguished from those other objects?  [For example, it will be the only closed 4-vertex Polyline in the Block?  Or the only thing on its Layer?  Or...?]

 

Would the Block ever be Inserted with scale factors other than 1, and/or rotation other than zero?  Would other-than-1 scale factors ever be not equal to each other [in absolute value]?

 

Probably other questions will arise, but start with those.

Kent Cooper, AIA
Message 3 of 5

Good questions. I'll try to answer:

The Rectangle is a 4 vertex 3D Polyline. It's the only 3Dpoly object in the block, but there are also solids. (The rectangle is parallel to XY on the first hand, but then rotated aprox. 15 deg around X and put in a block).

The block is inserted and scaled 1:1:1 but then rotated some deg. about X and some deg. about Y.

(It's a solarpanel defined with a standard angle of 15 deg, but inserted following terrain angles).

In the end, I am looking for the xy-coordinates in WCS.

 

Message 4 of 5

How about NCOPYing the 3DPoly out of the Block, and simply pulling the coordinates from the copy?  [And deleting the copy after.]  A routine should be definable that could do that all for you.  In what format would you want the WCS coordinates [an undifferentiated list of numbers such as in the 'Coordinates VLA property, or a list of point-coordinates sub-lists, or....]?

Kent Cooper, AIA
Message 5 of 5

Thank you very much.
I didn't know the NCOPY command.
I want to experiment with it.
I need a projection of the rectangle in Z=0 WCS.
And I think this is the way to do it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report