Jump to content

How to get WCS coordinates of an entity within a second level nested block?


Recommended Posts

Posted

Hi.

 

My problem is following:

 

I have an INSERT entity with nameDXF "X".

 

I have an nested INSERT (inside "X") with nameDXF "F".

 

Finally, I have a sphere that makes up the INSERT Block reference "F", the property "Position" is (0 0 0). In the drawing the position of the sphere is outside the origin of the WCS.

 

 

I need to transform the coordinates of the "Position" property of the sphere to the WCS.

 

I thought that this would have a result:

 

(setq T (trans ptoPosition F X))

(trans T X 0)

 

But I get nil in both cases.

 

 

Any comments on how I should use the TRANS function?

 

Greetings.

Posted

You will need to transform the coordinates of the center of the sphere using a transformation matrix calculated by multiplying the transformation matrices for each parent block reference - here is a similar example used in an existing program, written to account for any level of nesting.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...