Jump to content
sthodkin

Get and Set commands for objects

Recommended Posts

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

Share this post


Link to post

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);

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...