I'm creating series of plan views in a drawing. My approach has been to add each of them as blocks (the blocks are in real world grid coordinates) then insert them at an insertion point and rotation so they fit in he correct place on paper in the drawing. I create a UCS for each of them so that the correct real world coordinates can be toggled on and off for each.
The problem I'm having is that when I create my UCS, if it is rotated then sometimes the coordinates
are very slightly off, for example a point at 5000000,5000000 might appear as 4999999.9999,5000000.0001. I assume this a floating point error due to the transformation that I use to calulate the UCS origin (which interestingly is exactly same way I calculate the block insertion point and rotation).
for example, for a plan view centered on 0,0 on paper in my drawing.
Point3d paperOrigin = new Point3d(0.0, 0.0, 0.0);
Point3d ucsOrigin = new Point3d(-planViewX, -planViewY, 0.0);
ucsOrigin = ucsOrigin.TransformBy(Matrix3d.Rotation(planViewRo
tation, Vector3d.ZAxis, paperOrigin));
Im thinking there's got to be a better way of doing which would always retain exactly the same values between ucs and block coordinates.
Solved! Go to Solution.
Solved! by jamierobertson1. See the answer in context.
Figured it out, the accuracy problem was just down to the the way I was calculating the ucs axis parmaters.
On further investigation the ucs is correctly calculated. If I manually insert a block or xref in the newly created UCS, the coordinates match exactly. I only get the slight accuracy error if the block reference is inserted programatically in WCS at the correct origin and location.
Doesnt really help me much though... I need to create the plan views in newly created databases.
Access a broad range of knowledge to help get the most out of your products and services.