Y Axis direction flipped

Y Axis direction flipped

SanjivKapila
Participant Participant
716 Views
4 Replies
Message 1 of 5

Y Axis direction flipped

SanjivKapila
Participant
Participant

I'm trying to create a dissociated copy of dimensions in a 2D view. The recreated vertical dimensions are flipped in direction. Any clues please..

//..

dimLine.MakeBound(0, 1);
XYZ pt1 = GetDimensionStartPoint(dim);
XYZ pt2 = dimLine.GetEndPoint(1);
XYZ direction = pt2.Subtract(pt1).Normalize();

//..

The direction vector is negated for vertical dimensions in the plan view. Please check the attachments..

0 Likes
Accepted solutions (1)
717 Views
4 Replies
Replies (4)
Message 2 of 5

sanjiv_kapila777
Explorer
Explorer

@jeremytammik Sir! please help..

The purpose of creating Disassociated dimensions is that if something is deleted in a linked element or the file changes, the dimensions referencing linked elements also get deleted. We want to retain the dimensions even if the linked references are deleted.

0 Likes
Message 3 of 5

jeremy_tammik
Alumni
Alumni

Yes, I understand the intention. I looked at the code and do not see the problem off-hand. I worked on some tricky dimensioning issues myself for fabrications parts. I believe that some of the dimensions had to be simulated as well in my case. I think it looks as if you have the problem well in hand and recommend further head scratching and debugging to nail the past part. For instance, you can add more information to your output by creating additional elements to mark the orientation of the X, Y and Z axes in the view. Depending on the view direction, I often find that they may be surprisingly and sometimes inexplicably reversed. That is all I can say. Your situation is normal, your problem is standard, debugging and head scratching is your job, not mine.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 5

sanjiv_kapila777
Explorer
Explorer
Accepted solution

Thanks Jeremy Sir! 

debugging and head scratching worked for me.

Turns out that

XYZ direction = dimLine.Direction.Normalize(); worked correctly instead of

XYZ direction = pt2.Subtract(pt1).Normalize();

Regards

Message 5 of 5

jeremy_tammik
Alumni
Alumni

Congratulations and thank you for sharing your solution!

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open