Jump to content
Developer Wiki and Function Reference Links ×

SetCustomObjectPath


J. Miller

Recommended Posts

Hello,

I am attempting to update / edit a custom 3D path in an event enabled PIO.

I have allowed the user to have access to edit the path thru a double click on the PIO.

When the user is done with the edit, I need to make sure the new path is correct and make adjustments to it.

I am using

BeginPoly3D;

Add3DPt(p1.x , p1.y , p1.z);

Add3DPt(p1.x , p2.y , p2.z);

EndPoly3D;

newPathHan := LNewobj;

boo:= SetCustomObjectPath(pathhan, newPathHan);

message('New Path ', boo);

{p1.x twice is correct, i need to keep the "X" position the same in both points}

but it fails. Is there a particular place in the PIO i need to place this so that it will actually reset the path PIO points?

Thanks,

Jeff Miller

Link to comment
  • Vectorworks, Inc Employee

The code is creating a new object in the path. Since there can only be one object in the path the user's path is destroyed.

If this is your PIO it should simply use the newPathHan to create the object based on the path.

If this is another object you may need to call a reset on the object to force it to regenerate and look at the updated path.

Link to comment
  • Vectorworks, Inc Employee

You can replace the poly entirely or you can modify the existing poly in the path group by using SetPolyPt3D() and AddVertex3D(), you just can't add another poly to the to the path group because it will erase the original one.

Link to comment

Pardon my ignorance.

This is my 1st attempt with a 3D path object and the double click edit mode.

Where would one place the setPolyPt3D() call to actually move the user placed position to a position I want it to be at, So that when the pio is double click again the points display the actual current position of the pio and not the positions that the user clicked?

Is there an example floating around that I could get a look at?

Jeff

Link to comment
  • Vectorworks, Inc Employee

I don't have any sample code but it would go something like this:

PathH := GetCustomObjectPath(ObjectH);

FOR i := 0 TO (GetVertNum(PathH ) - 1) DO

BEGIN

GetPolyPt3D(PathH , i, vertX, vertY, vertZ);

If (Poly Point in the wrong Place) then

SetPolyPt3D(PathH,i,vertX1, vertY1, vertZ1);

END;

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...