Hippocode Posted May 6, 2013 Share Posted May 6, 2013 Since the only vs-function I could find was "CntrlPtVis", is it only possible to use controlpoints with SDK ? Quote Link to comment
Vectorworks, Inc Employee klinzey Posted May 6, 2013 Vectorworks, Inc Employee Share Posted May 6, 2013 You can use control points (2D) in VS but you must create them as parameters within the Plug-in editor. With the SDK you can create control points dynamically as you need them. Quote Link to comment
Dieter @ DWorks Posted May 6, 2013 Share Posted May 6, 2013 With the SDK you can create control points dynamically as you need them. This is also possible from within VS. I once did this to create extra control points, but it's a lot of work and not so simple to do in VS. Quote Link to comment
Hippocode Posted May 7, 2013 Author Share Posted May 7, 2013 You can use control points (2D) in VS but you must create them as parameters within the Plug-in editor. Ah it didn't work earlier, probably because I didn't set a standard value on it. Quote Link to comment
Hippocode Posted July 2, 2013 Author Share Posted July 2, 2013 (edited) Hi, I've got an issue with my CP. A PIO that has one CP, standard coord on (0,0) resets them when they are (0,0) for the first time to match the center of a path object. With HCenter, the coordinates are correct and the CP is in the middle of my object. The issue starts when I move the object, as the CP doesn't change in coordinates (x,y) yet it follows the new position of the object. Visually this is correct, but the coordinates are wrong. From this point I can move the CP, and the distance is added/substracted from the coordinates, but the basis is still wrong as mentioned earilier. As another script needs the chosen "point", it misses the distance if the object was moved, which makes duplicating this object also impossible due to wrong CP data.. I was thinking of looking for the "move" event, calculating the change in X/Y and manually adding that to each coordinate, but that looks a hassle to me + I'm not so sure it will be visually correct as it is now. Just the data.... hmppf Edited July 2, 2013 by hippothamus Quote Link to comment
Dieter @ DWorks Posted July 3, 2013 Share Posted July 3, 2013 A control point is always relative to the plugin center point. So it works like designed. If you want a point to be set in the drawing and want these coordinates, you need to use other methods: One would be that you save the coordinates in some field and adjust the control point when the plugin is moved/updated. Another one would be that you work with another object which you reference. There are other solutions to.... Quote Link to comment
Hippocode Posted July 3, 2013 Author Share Posted July 3, 2013 A control point is always relative to the plugin center point. So it works like designed. If the CP coordinates where relative as in (object centerpoint + CPposition) then the CP would change on moving the object? That's what I don't get. When its drawn at first, and when only the CP is moved, the CP coordinates match the drawing coordinates at the bottom, so I'd think the CP position is absolute. But on objectmove the coordinates don't get any update, while the CP does move with the object ? Quote Link to comment
JBenghiat Posted July 3, 2013 Share Posted July 3, 2013 Control points are indeed relative to the origin of the PIO. A CP 12" above the insertion point, for example, should have the coordinates (12, 0). They are also on a grid rotated with the PIO, so by "above," I mean with respect to the PIO's rotation. When you interact with a CP, you can get accurate cursor coordinates, but those values are not the same as those stored in the OIP. There are some issues with a user-moved origin causing incorrect CP values in the OIP. You may want to check that your origin is reset for initial testing. A CP is really just an extra reshape handle. I think what you are describing for your needs is actually a locus representing the centerpoint and x-center, y-center parameters for the OIP. You would need to calculate the center of the object with respect to the PIO origin, then add that to the insertion point of the PIO, which you can get with GetSymLoc. Don't forget to account for the PIO's rotation -- vectors can be your friend. -Josh 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.