P1.distancetosurface() function doesnt work properly when P1 defined by an offset target

P1.distancetosurface() function doesnt work properly when P1 defined by an offset target

eonishuk
Participant Participant
807 Views
5 Replies
Message 1 of 6

P1.distancetosurface() function doesnt work properly when P1 defined by an offset target

eonishuk
Participant
Participant

I made a very simple version of a sidewalk and curb subassembly I am building to show the issue I have run into. 

The bottom right hand corner of this assembly (P3) is defined in X by an offset target "Offset" and an existing ground line "EG". P3 should be at the intersection of these two points. If i override the offset target with a fixed number, the program works fine and the point will intersect the EG line fine(picture 2), But if I link the offset target, that corner does not quite hit the blue line of the EG line (picture 3). Unfortunately its hard to see because the colors are not well contrasted. What is happening here? it is as if the offset target is reading something wrong.

0 Likes
Accepted solutions (2)
808 Views
5 Replies
Replies (5)
Message 2 of 6

ecfernandez
Mentor
Mentor
Accepted solution

Hi @eonishuk. My advice would be just don't do it that way. Build P3 as a "Delta X on Surface" point. The Delta X will be P2.X, and the surface your ExistingSurface (The name doesn't appear in the photo).

ecfernandez_0-1655240536786.png

 

This way you'll always get P3 right on top of your ExistingSurface at the same distance from the origin as P2 and vertical to that same point.

I hope this helps, best regards!

Camilo Fernández

Civil engineer | Specialist in design, construction, and maintenance of roadways

EESignature

LinkedIn
0 Likes
Message 3 of 6

RonaldBrañez
Advocate
Advocate
Accepted solution

First, in SAC define P2 as Type: Angle and Delta X and assign the properties as seen in the following image.

01.PNG

 

 

Then, P3 defines it as indicated by Camilo Type: Delta X On Surface

02.PNG

Remember that the API Offset function gives you the distance from the baseline (the alignment), that is to say that in C3D the point P2 will not coincide with the target. In SAC it will look correct, but in C3D it won't work as you planned. In any case, it is better to use the API function P#.X (P2.X) if tou need the X position of any point.

 

Regards.

Message 4 of 6

eonishuk
Participant
Participant

Thank you so much for your quick response! Your solution worked and my problem is solved. 

Message 5 of 6

eonishuk
Participant
Participant

@RonaldBrañez ,  Thanks so much for your solution and explanation. My subassembly appears to be working correctly now. It makes so much more sense now why what I was doing was not working!

 

Thank you!

0 Likes
Message 6 of 6

ecfernandez
Mentor
Mentor

Hi guys! Happy to help. Good to know you could solve your problem @eonishuk.

Best regards to both of you!

Camilo Fernández

Civil engineer | Specialist in design, construction, and maintenance of roadways

EESignature

LinkedIn
0 Likes