Jump to content

VvierA

Member
  • Posts

    182
  • Joined

  • Last visited

Posts posted by VvierA

  1. I have a script that converts Polygons in a custom object named 'db Allesstempel'.

    The workflow is: you select one or more polygons, you call the script via menu command, and boom: the script converts the polygons to this custom path object named 'db Allesstempel'.

    The problem is:

    It worked fine for a long time but since one of the last VW Updates it does not work within annotations of viewports if I want to use it on MORE than ONE selected polygon.

    It stops with this error: error on line...

    SObjectHandle[zaehl] := objectH;

    ... ZAEHL - index outside array limits:

    Why does this happen? There is a function "H_FSActContainer", that checks what's selected. This worked fine for a long time, even within annotations. Now there seems to be a problem. Can anybody help?

    Kind regards

    VvierA

    --------------------------------------

    PROCEDURE allesstempelkonverter;

    VAR

    objectH, newobjH :HANDLE;

    SObjectHandle :DYNARRAY [] OF HANDLE;

    numsel, zaehl :INTEGER;

    FUNCTION H_ActContainer: HANDLE;

    BEGIN BeginContext;

    Locus(0, 0);

    H_ActContainer := GetParent(LNewObj);

    DelObject(LNewObj);

    EndContext(0);

    END;

    FUNCTION H_FSActContainer: HANDLE;

    VAR h : HANDLE;

    BEGIN h := FIn3D(H_ActContainer);

    WHILE (h <> NIL) & (Selected(h) = FALSE) DO

    IF Selected(h) THEN

    H_FSActContainer := h

    ELSE

    h := NextObj(h);

    H_FSActContainer := h;

    END;

    BEGIN

    objectH := H_FSActContainer;

    numsel := Count((SEL=TRUE));

    ALLOCATE SObjectHandle[1..numsel];

    zaehl := 1;

    WHILE (objectH <> NIL) DO BEGIN

    SObjectHandle[zaehl] := objectH;

    zaehl := zaehl+1;

    objectH := NextSObj(objectH);

    END;

    {message (numsel,' Zähler ',zaehl);}

    {in der zweiten Schleife werden die Objekte umgewandelt}

    zaehl := 1;

    WHILE zaehl <= numsel DO BEGIN

    IF (GetType(SObjectHandle[zaehl]) = 3) OR {Prüfung ob es ein Rectangle ist}

    (GetType(SObjectHandle[zaehl]) = 4) OR {Oval}

    (GetType(SObjectHandle[zaehl]) = 5) OR {Polygon}

    (GetType(SObjectHandle[zaehl]) = 6) OR {Bogen bzw. Kreis}

    (GetType(SObjectHandle[zaehl]) = 21) THEN BEGIN {Polyline}

    { SetPenFore(SObjectHandle[zaehl],45);}

    newobjH := CreateCustomObjectPath('db Allesstempel', SObjectHandle[zaehl], nil);

    END;

    zaehl := zaehl+1;

    END;

    END;

    run(allesstempelkonverter);

  2. @Miguel

    The symbol within my PIO has some text that is linked to a database record.

    I like to read out this info an write it to the PIO parameters of the parent PIO.

    Why would I do that?

    In some cases I'd like to edit the database record entries from within a worksheet list.

    Vectorworks changes the info in the text symbol that is linked to the database accordingly.

    The problem is: the correlative parameters of the PIO do not change automatically.

    If the PIO gets refreshed by another reason (for example resizing etc.) the database entries will be changed back to the values that are still 'stored' in the PIO parameters.

    Therefore I'd like to write a script to sync the database entries to the PIO parameters.

    Maybe I can work out how to traverse the PIO and how to identify the embedded symbol thanks to Miguel.

    I'm not a Pro so any additional help will be appreciated very much.

  3. Sorry for asking again, but I don't know really how to traverse the PIO to get a handle to the symbol within.

    I have an handle in an array of handles to every PIO I'd like to check for contained symbols. I thought, I could look 'inside' every PIO with....

    ForEachObjectInList(actionFunc, objOptions, travOptions, list)

    With travOptions = 1

    I should bei able to traverse inside the PIO.

    But what's the 'actionFunc' to get a handle to the symbol inside the PIO?

    And what do I use vor 'objOptions' and 'list'?

    Thanks for help again

  4. @Hippocode

    Thank you for the help.

    The background is:

    I can generate a list on a worksheet with the database info of the symbols that are embedded in the PIOs.

    I can edit the retrieved database info in the worksheet.

    If the database info was linked directly to the object, Vectorworks would rewrite the data to the object.

    Because the database info is linked to the embedded symbol and not to the PIO directly this does not work.

    Therefore I'd like to read out the edited database info and send this info to the parameters of the PIO to match both.

    I think I'll try this:

    I can get a handle to each PIO. Then I search within each PIO for the symbol with record information and get a handle to this. With this handle I read out the record entry for the symbol and patch it to the PIO parameters with the PIO's handle.

  5. Hello again,

    thanks for the help with the other issues.

    I have a 2D path PIO with an embedded symbol.

    Does anybody has a clue how to get a handle to a symbol that is nested inside a PIO?

    I'd like to make another Vectorscript to manipulate the POI objects inside the drawing. Therefore I need to get a handle to the symbols inside the POI objects.

    Any ideas?

  6. Yeah, thank you for the quick response.

    But if I use the worksheet criteria in my script, the script only works with this certain worksheet. Or is there a way to read out the criteria of a list?

    Maybe something like this?

    I click on the first row of the list and call the Script with the contextual menu (right mouse button). The script 'reads out' the criteria of the list and selects each item.

  7. I totally agree with zoomer.

    Most of the users can't imagine the benefits of substantial changes once the got used to some piece of software. People are very anxious with changes.

    It's a general problem. That's why VW became overloaded with features over the years and why the user interface became overcrowded and confusing. The developers don't dare to streamline the software and to modernize it substantially. Instead they just add features every year. (Sorry if that sounds a little bit harsh but I can imagine how difficult it is to evolve a piece of software that has such a long time client base.)

  8. Do you mean that when you hover over the custom point object, or another object that's not your plugin? Or do you mean one of the objects in your plugin?

    What exactly do you need to do? I get the impression it's not an custom object you need.

    I'd like the following usage:

    - select the tool

    - hover over the drawing with the cursor

    - VW should highlight the graphic elements while I hover (could be everything - not necessarily a custom object)

    - I click one one of the graphic elements while it is highlighted

    - my plugin object retrieves information of that element and my object is placed right there where I clicked

    - the plugin object shows information of the element like a stamp (for example the area of the element)

    And yes: maybe it's more like a custom tool than a custom plugin object.

    Do you think, I can succeed by making a tool rather than a plugin object?

    I'm not sure this is possible with VS.

    What you need to do is to overwrite the tool behavior, particularly the mouse move and click events.

    If there is no way of overwriting the tool, you might do it with a menu command instead or object event:

    http://developer.vectorworks.net/index.php/VS:vstGetPickObject

    You could trigger this by a button in the OIP.

    Thank you, I will have a look at it. Maybe it works.

  9. Hi everybody,

    another day, another challenge...

    I'd like to make a custom point object with the following feature:

    When I hover with the cursor over drawing elements they should highlight in the standard Vectorworks manner. By clicking on one of the highlighted elements the plugin should retrieve information of the element (for example the area of that element).

    Does anybody know, how to do this?

    If I make a new custom point object and start it, there is no highlighting while hovering over the drawing. And in the next step I wouldn't know how to get a handle to the element I clicked on.

    Thanks for help

    VvierA

  10. I've done that before. I programmed a plug in object as a tool.

    Then I programmed a menu command, that called that plug in object to generate several instances of it in the drawing.

    Now I'd like to merge the two pieces of code into one.

    Why would I do that? Because I don't need the plug in object as a separate tool. I only need it in combination with that menu command that populates the drawing with instances of it.

    But maybe that is not possible and I have to do it separately.

  11. What do you mean convert symbols to custom plug-in objects? They are totally different. Do you have a use case? I think you are looking for a custom object instead of a menu command, one that will use a symbol in it. Please tell us your use case so we can come with good solutions.

    Well, I am looking vor a custom object, that is generated by a menu command.

    I know that it is possible to program a custom object and to 'call' this object from within a menu command. But that is not what I want. I'd like to generate the custom object directly with the menu command. In this special case I'd like a symbol to be part of the newly generated custom object.

    What's the purpose?

    I'd like to program a stamp, that shows the area and perimeter of polygons.

    It is used by selecting polygons and applying a menu command to call a Vectorscript.

    The menu script reads the area an perimeter of each polygon and places a symbol with text showing the area and perimeter next to each polygon. I'd like the symbol to be part of a custom object. So I can access the object info palette for this 'stamp object' and make changes, for example select another symbol or scale the symbol and so on.

  12. Well, just use CreateCustomObject or the equivalent for path based objects.

    Hello Hippocode,

    thank you for the input. If I am right, my problem is:

    The 'CreateCustomObjekt' commands need the name of the object.

    So I have to create a custom plugin object tool with a certain name in the first place to use it within my Vectorscript menu command. I would be happy if there was another way.

    I'd like VW to create custom objects directly by only using the Vectorscript menu command. I'd like to call the menu command and than it should populate the drawing with symbols that are not only symbols but custom objects.

  13. Hi there,

    I made a Vectorscript menu command that automatically places symbols in the drawing.

    Now I'd like the Vectorscript to 'convert' the symbols to custom plug-in objects.

    The purpose is to have access to the parameters defined within the Vectorscript menu command from within the object info palette.

    The Vectorscript command should 'transform' the symbols to custom plug-in objects before placing them in the drawing.

    Any ideas?

    Thank you

    VvierA

  14. I totally agree with the concept of core modeling.

    The advanced parametric tools do not work for us ever since.

    The settings are either too complex or too simple. They never really fit.

    Even the 'wall'-tool is both too complicated and too limited.

    However there are huge improvements for 3d modeling.

    And there is still potential for further improvements to simplify the workflow and reduce the number of clicks for certain processes.

    I would love to see Nemetschek US to focus on improving the workflows and the user interface of core 3d modeling and to evolve the concept of 'marionette'.

    In combination with as strong database concept this would be a very powerful tool, that might be capable to make parametric tools completely redundant.

×
×
  • Create New...