To whomever reads,
What I am trying to do is calculate the other side of the rectangular block given these values.
I can get the "Normal" property, Insertion Point, and "Rotation" property of a rectangular block in 3 space. I can also use the "XScale" property to get its length. If someone could give me some example code they have for calculating something like this, I would really appreciate it.
I would already be done except the rotations in AutoCAD are wierd. I have found that if the block is rotated about the y axis of WCS at all the zero rotation is where the block lies on the x,y plane.
I'm trying to figure out how to calculate the rotational offset due to object coordinate system. There must be an easier way.
I think a sample drawing or an image would help.
Is the Block 2- or 3-dimensional? I assume from your saying you can get the length from the X scale that it's a unit-sized Block in its base definition, presumably either a 1x1 square or a 1x1x1 cube. Is its insertion point at a corner [and if so, which one?], or in the middle, or....?
What do you mean by "the other side" of the rectangle Block? In the case of one rotated only about the Y axis, and assuming a 2D rectangle with its insertion point is at the lower left, are you looking for the WCS X and Z coordinates of its right edge? Or some point location in 3D, perhaps the upper right corner [opposite the insertion point]?
Might its bounding box tell you what you want to know? That will identify the extents of it in all three directions.
I have an example attached.
These represent cable trays. Look at the white end of the rectangle shapes. I'm trying to write a lisp routine where the user clicks the ends of the trays they want to move, then clicks the point where they are supposed to attach. In this case, all the tray except the top should be shorter by some amount. However, the insertion point of the block might be the high side of that rectangle, meaning the tray would have to move if it were getting longer. Also, when the trays are vertically stacked and not staggard, they want to be able to stretch all the trays at one time and not change in the z direction. Here is what I have currently.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.