Jump to content

VvierA

Member
  • Posts

    182
  • Joined

  • Last visited

Posts posted by VvierA

  1. Cool, thank your for that hint. I used GetClass and SetClass to get the Class of the PIO and assign it to the polyline.

    May I ask another thing?

    I try to scale the symbol that is placed together with the polyline as a part of the custom PIO.

    I tried ScaleObjectN but it needs a constant (?) named 'const WorldPt&' as scale center. I do not know what that is? How can I define the scale center with just one value?

    http://developer.vectorworks.net/index.php?title=VCOM:VectorWorks:ISDK::ScaleObjectN

    VvierA

  2. Hello,

    I made a custom 2d path object tool to generate special 2d polygons.

    It works great and I can use the tool to generate the polygons.

    The problem is:

    If I try to change the class of the PIO afterwards the polygon does not adopt the graphic attributes (line color, line weight etc.) of the new class.

    Do you have any hints?

    Thank you,

    VvierA

    P.S.

    I generate the polygon by using the 2d path tool and with 'CreateDuplicateObject'.

  3. Hello again,

    this forum is really great. I hope I may ask another question.

    I made a 2d path plugin object with an embedded symbol.

    Now I try to generate control points for the 4 corners of the symbol.

    The symbol varies in size so I thought I have to retrieve the width and height of the symbol via Vectorscript.

    I tried: widthVAR := width(S=symbolnameSTR) but it doesn't work.

    Maybe there is another way to retrieve (calculate) the x/y coordinates of the corners of the bounding box of the embedded symbol?

    Or maybe there is an even more simple way to place control points in the corners of an embedded symbol?

    Thank you for tips and hints,

    VvierA

  4. @Kevin

    Great - the code works very well (although I do not understand the meaning yet).

    Maybe you can help with another (related) question...:

    Together with my 2d path I place a symbol.

    Is there a way to evoke an edit mode so that I can move that symbol 'within' my 2d path object. I.e. move it without ungrouping = destroying the 2d path object?

    VvierA

  5. Hello,

    I try to make a custom 2d path object with Vectorscript.

    The object has a lot of parameters but the object info palette shows only 7 of them.

    Is there a limitation of parameters for the object info palette?

    How can I get over the limitation?

    or

    Is there another 'simple' way to allow the user to enter parameters for a path object other than the object info palette?

    (I do not feel capable to program a custom dialog so it would be great to enter the values via the object info palette.)

    Thanks for help

    VvierA

  6. Thank you very much Miguel.

    In the meantime I examined the script of Example 9 and succeeded to make an alternative solution to generate a 2D path by duplicating the drawn vertex path (see code below).

    Anyway I am looking now for a way to automatically close the polygon.

    Do you know a way to 'access' the 'close'-Checkbox via Vectorscript?

    VvierA

    PROCEDURE 2dpath;

    VAR

    theEvent, theButton :LONGINT;

    result :BOOLEAN;

    objHand, recHand, wallHand, pathHand, dupeHand :HANDLE;

    objName :STRING;

    BEGIN

    IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN

    BEGIN

    pathHand := GetCustomObjectPath(objHand);

    dupeHand := CreateDuplicateObject(pathHand, objHand);

    END;

    END;

    Run(2dpath);

  7. Thank you Miguel.

    If I understand you correctly I have to insert code that draws the lines. And I get the coordinates to draw the lines from the data that is returned by the vertex code.

    What confused me was an example I found at vectorlab (Example Nr. 9)

    http://www.vectorlab.info/index.php?title=Events#Example_9

    It's actually an example to explain Object events but it uses the 2D Path object and so I tried it.

    There is lots of object event code inside but strangely I can not find any code for drawing lines or polygons in this script. So how does it work?

    Thanks again

    VvierA

    P.S.

    Strange enough the example does not work like it should. It should go 'into 2D Reshape mode on double click' but if I double click an instance of that object it goes into the 'edit path object profile' mode.

  8. Hello,

    I am a beginner and to start with vectorscript I'd like to make a simple 2D path object. It should work like the standard Vectorworks polygon tool but the polygon should close automatically after creation.

    I succeeded to generate a new 'empty' 2d path object with no code yet and to integrate this new tool in my workspace.

    Although there is no code yet, I can draw a 2D polygon shape.

    The problem is: the shape is invisible. It shows no lines and no filling.

    I can select it by 'select all' and it is shown in the info palette but it is not possible to change the appearance to make it visible.

    Question:

    What code do I have to add to make the path visible respectively to make this 'generic' 2d path behave like the original 2d polygon tool?

    Kind regards

    VvierA

  9. Hello,

    I am a beginner and to start with vectorscript I'd like to make a simple 2D path object. It should work like the standard Vectorworks polygon tool but the polygon should close automatically after creation.

    I succeeded to generate a new 'empty' 2d path object with no code yet and to integrate this new tool in my workspace.

    Although there is no code yet, I can draw a 2D polygon shape.

    The problem is: the shape is invisible. It shows no lines and no filling.

    I can select it by 'select all' and it is shown in the info palette but it is not possible to change the appearance to make it visible.

    Question:

    What code do I have to add to make the path visible respectively to make this 'generic' 2d path behave like the original 2d polygon tool?

    Kind regards

    VvierA

  10. Hello,

    I am registered user of the german version of Vectorworks 'Fundamentals', called Vectorworks 'Basic'.

    There is a menu command called 'Klassen...' in the context menu (right click).

    I tried to call this menu via

    DoMenuTextByName('Klassen...', 0);

    but Vectorwords does not recognize the Menu.

    'Error: KLASSENTOOL DOMENUTEXTBYNAME - Menu cannot be found. Klassen...'

    Does anybody know if there is a limitation to the procedure to certain menu commands and is there another way to call the Menu?

    Best regards

    VvierA

  11. Hello there,

    another simple question for a beginner like me:

    I generated a polyline with VS.

    Closepoly;

    Beginpoly;

    AddPoint(0,-(PBOXWIDTH/2));

    AddPoint(pLINELENGTH,-(PBOXWIDTH/2));

    AddPoint(pLINELENGTH,(pBOXWIDTH/2)-(gefprozentv*pLINELENGTH));

    AddPoint(0,(PBOXWIDTH/2));

    Endpoly;

    Now I want to change the visibility of the line segments with SetVertexVisibility.

    But I need a handle to the previously generated polyline.

    How do I get it?

    Thank you for help

    VvierA

  12. Hello Josh,

    thank you very much so far. Finally I got it. I read some warning about the complexity of event management in Vectorscript and decided to try the other method with the hidden parameter to compare the values. It works great.

    The setting of the parameter also works now even though I do not know what the problem was. Maybe the restart of VW helped. The debugger is also very helpful.

×
×
  • Create New...