hagemeijer Posted January 15, 2020 Share Posted January 15, 2020 Hello forum, I have a polyline object with another polyline cut out of it. If I traverse the poly in vectorscript with vertexNum and GetPolylineVertex I only get the surrounding points, not the one that make the cut out part. How do I get to this part of the polyline? Thanks! Quote Link to comment
JBenghiat Posted January 15, 2020 Share Posted January 15, 2020 Try this: http://developer.vectorworks.net/index.php/VS:GetHole Quote Link to comment
hagemeijer Posted January 17, 2020 Author Share Posted January 17, 2020 Thank you Joshua, strange I didn't see that before... I have another question for the creation of a polygon and or polyline: with getObjectVariableInt (h, 696) I get the fill type of the polygon. If I want to set the type with setObjectVariableInt (h1, 696, str2num(s)) where s is "2" for a solid color I get an error that constant 696 is not supported for the handle. h1 points to a kpolylinenode. Can someone please help me with how to set the fill type? Quote Link to comment
MullinRJ Posted January 17, 2020 Share Posted January 17, 2020 @hagemeijer , Try 695, but note it is a Longint ObjVar. Raymond Quote Link to comment
JBenghiat Posted January 18, 2020 Share Posted January 18, 2020 If you're just looking at solid and none, you can use http://developer.vectorworks.net/index.php/VS:SetFPat with 1 and 0 respectively Quote Link to comment
hagemeijer Posted January 21, 2020 Author Share Posted January 21, 2020 Hello Raymond, 695 works ok! The confusion is style vs type... I am building a way to select items in a drawing, export these to a text file and reproduce the drawing from the text file. The text is stored in a database and I can be selected from the database to add to a drawing, to add details to the main drawing. Creating an arc can be done 2 different ways but I think center and radius is the easiest. Does anyone have a solution to get the radius of a drawing. I must be again missing something, but I can't find a objectvar or procedure to get it... Quote Link to comment
hagemeijer Posted January 21, 2020 Author Share Posted January 21, 2020 Off course I mean the radius of an arc object... Quote Link to comment
JBenghiat Posted January 21, 2020 Share Posted January 21, 2020 You may want to try File>Export>Script. This will show you what data gets set via direct function call verses object variables. For most Set... commands there is a corresponding Get... command. Typically you want to look at the function reference first, and only look at object variables when they are not otherwise obtainable with a command. This is a little less obvious with an arc. You can use Get2DPt to get the center (index 1) and a point on the arc (index 2) and calculate the radius. http://developer.vectorworks.net/index.php/VS:Get2DPt Quote Link to comment
MullinRJ Posted January 21, 2020 Share Posted January 21, 2020 @hagemeijer , If you have a handle to an ARC (or CIRCLE) object, you can't GET the radius directly, but you can calculate it: GetArc(H, Start, Sweep); Radius := hPerim(H) / Deg2Rad(Sweep); where "H" is the handle to the object. OR as Josh says: Get2DPt(H, 1, Pc.x, Pc.y); Get2DPt(H, 2, P1.x, P1.y); Radius := Norm(P1-Pc); where "H" is a Handle to the object and Pc and P1 are Vectors. Raymond 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.