.NET

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

Large UCS origin, transformations / accuracy troubles

301 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?

 

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

Active Contributor
jamierobertson1
Posts: 39
Registered: ‎04-11-2004
Message 2 of 3 (289 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 (275 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!