J. Miller Posted October 25, 2013 Share Posted October 25, 2013 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 Quote Link to comment
Vectorworks, Inc Employee klinzey Posted October 25, 2013 Vectorworks, Inc Employee Share Posted October 25, 2013 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. Quote Link to comment
J. Miller Posted October 31, 2013 Author Share Posted October 31, 2013 I can get it to draw correctly, but is there a way to re-set the poly point vertex of the pio to the end result of the pio? If the user double clicks on the object again the edit points are shown at the begining and end of the path pio. Jeff Quote Link to comment
Vectorworks, Inc Employee klinzey Posted October 31, 2013 Vectorworks, Inc Employee Share Posted October 31, 2013 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. Quote Link to comment
J. Miller Posted November 1, 2013 Author Share Posted November 1, 2013 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 Quote Link to comment
Vectorworks, Inc Employee klinzey Posted November 4, 2013 Vectorworks, Inc Employee Share Posted November 4, 2013 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; Quote Link to comment
Recommended Posts
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.