.NET

.NET

Reply
Active Contributor
jamierobertson1
Posts: 39
Registered: ‎04-11-2004
Message 1 of 3 (296 Views)
Accepted Solution

Large UCS origin, transformations / accuracy troubles

296 Views, 2 Replies
10-22-2010 04:57 PM

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?

 

Active Contributor
jamierobertson1
Posts: 39
Registered: ‎04-11-2004
Message 2 of 3 (284 Views)

Re: Large UCS origin, transformations / accuracy troubles

10-23-2010 05:56 AM in reply to: jamierobertson1

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.

 

 

Active Contributor
jamierobertson1
Posts: 39
Registered: ‎04-11-2004
Message 3 of 3 (270 Views)

Re: Large UCS origin, transformations / accuracy troubles

10-23-2010 01:45 PM in reply to: jamierobertson1

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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.