sthodkin Posted June 13, 2020 Share Posted June 13, 2020 Hello, I was wondering if there was any documentation on all the functions associated with objects in VectorScript? As an example, I am trying to calculate the angular dimensions between all points on a closed polyline... The following script seems to do a nice job of displaying and Angular Dim Object at each point Quote FOR vertexNum := 1 TO GetVertNum(obj) DO BEGIN if (vertexNum = 1) then {Processes first vertex in polyline} begin {Get the current point} GetPolylineVertex(obj, vertexNum, ptX, ptY, vertexType, arcRadius); {get the pervious point} GetPolylineVertex(obj, GetVertNum(obj), prevPtX, prevPtY, vertexType, arcRadius); {Get the next point} GetPolylineVertex(obj, vertexNum+1, NxtPtX, NxtPtY, vertexType, arcRadius); end else if (vertexNum = GetVertNum(obj)) then {Process last item in polyline} begin {Get the current point} GetPolylineVertex(obj, vertexNum, ptX, ptY, vertexType, arcRadius); {get the pervious point} GetPolylineVertex(obj, vertexNum-1, prevPtX, prevPtY, vertexType, arcRadius); {Get the next point} GetPolylineVertex(obj, 1, NxtPtX, NxtPtY, vertexType, arcRadius); end else {Processes all other items in polyline} begin {Get the current point} GetPolylineVertex(obj, vertexNum, ptX, ptY, vertexType, arcRadius); {get the pervious point} GetPolylineVertex(obj, vertexNum-1, prevPtX, prevPtY, vertexType, arcRadius); {Get the next point} GetPolylineVertex(obj, vertexNum+1, NxtPtX, NxtPtY, vertexType, arcRadius); end; {adds angular dims to each corner} AngularDim(prevPtX, prevPtY, nxtPtX, nxtPtY, ptX,ptY,1.7001838",771,770,#35d 32'16"); END; However I was wondering how I could get the dimension that is displayed "out" of this object? I know it can be calculated using tan θ =(m2−m1)/1+(m1m2) but I was wondering if there was a way of getting if from the angular dim that has been create? Along these lines I was wondering if there is a reference somewhere that has all the various functions associated with objects in VectorScript? as examples: get(), set(), charAt() toInt etc? Many thanks Quote Link to comment
MullinRJ Posted June 13, 2020 Share Posted June 13, 2020 The Script Function Reference can be found in your VW application VWHelp folder undoer VWHelp > Script Reference. The same documentation is also available online at https://forum.vectorworks.net/index.php?/announcement/14-developer-wiki-and-function-reference-links/ HTH, Raymond Quote Link to comment
Pat Stanford Posted June 14, 2020 Share Posted June 14, 2020 The below will get you the string representation of the dimension value. If you need to convert it to a number you can use STR2Num() GetDimText VectorScript Declaration: FUNCTION GetDimText ( h:HANDLE ) :STRING ; Python: def vs.GetDimText(h): return STRING Description: Function GetDimText returns the dimension value displayed with the referenced object. Parameters: hHandle to object. Example: DimValue:=GetDimText(HandleToObj); 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.