.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Large UCS origin, transformations / accuracy troubles

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jamierobertson1
495 Views, 2 Replies

Large UCS origin, transformations / accuracy troubles

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(planViewRotation, 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.

Anyone?

 

2 REPLIES 2
Message 2 of 3

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.

 

 

Message 3 of 3

Figured it out, the accuracy problem was just down to the the way I was calculating the ucs axis parmaters.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost