Jump to content

twk

Member
  • Posts

    877
  • Joined

  • Last visited

Posts posted by twk

  1. Just starting trying to add dialogues in my PIO's, thought I'd start with normal scripts first.

    Copying examples in from the vs developers wiki don't really work as I'd expect them, here's an example below:

    PROCEDURE Dialog;

    VAR

    dialogID : INTEGER;

    BEGIN

    dialogID:=CreateLayout('Title', FALSE, 'Ok', 'Cancel');

    {This push button will appear left of the OK and Cancel button.}

    CreatePushButton(dialogID, 12605, 'Extra button');

    CreateGroupBox(dialogID,7,'Visibility',FALSE);

    CreateRadioButton(dialogID,8,'Visible');

    CreateRadioButton(dialogID,9,'Grayed');

    CreateRadioButton(dialogID,10,'Hidden');

    IF RunLayoutDialog(dialogID, NIL ) = 1 THEN

    BEGIN

    END;

    END;

    RUN(Dialog);

    Running that only shows the extra button, the ok button and the cancel button,

    it isn't showing the other ones, the groupbox/radio buttons, anyone know what I've done wrong?

    Thanks in advance

    Tui

  2. Hi Everyone

    I'm trying to call the current active class of the document and display it as text in my PIO,

    unfortunately using

    Procedure Main;

    VAR

    {VAR's for CustomPIO handling, etc}

    Procedure ActClTest;

    Begin;

    MoveTo(0,0);

    BeginText;

    ActClasSt

    EndText;

    End;

    Begin;

    IF GetCustomObjectInfo(PIONameh, hParm, hParmRecord, hWall) & (hParm <> Nil)

    THEN BEGIN

    ActClasSt := ActiveClass;

    ActClTest;

    END;

    is showing the current class of the PIO object, not the document.

    How can I show the active 'documents' class not the PIO's class.

    Thanks in advance

  3. Vectorworks 2014 hasn't been released in NZ yet, end of the month. So counting the days.. :D

    However I haven't seen anywhere online (vectorworks main website, service select members area, developer site for vectorworks) about the added python scripting language.

    Does anyone know when we'll be seeing some examples/tutorials? Or if those who got the release today had any manuals/example scripts bundled together with the releases?

    Cheers

    Tui

  4. FOR i:=1 TO WbDupNum-1 DO

    BEGIN

    DSelectAll;

    Symbol('01BevBack',130*i,20,0);

    HMove(LNewObj, PCavBotOff,0);

    SymboltoGroup(LNewObj,2);

    UnGroup;

    h2LastWB := LNewObj; {Handle to Last Weatherboard}

    SetFPat(h2LastWB, 4);

    END;

    Above is a snippet from a PIO I'm writing.. I'm trying to set the last object in that array to a handle so I can use it to run a clipsurface command. Unfortunately the LNewObj doesnt seem to be calling the last polygon created in this array. Anyone know why?

    Thanks

    Tui

  5. Hi Guys Thanks for the help. Really appreciate it.

    Josh you were saying that JkTrAdd is a handle(pointing to the newly added surface) and this is temporary? So trying to call a function or calculation further down the line of code using JkTrAdd would not be possible? Like for instance I wouldn't be able to say HDuplicate(JkTrAdd,x,y)?

    Nevertheless I am slowly understanding the syntax usage.(keyword slowly l:) )..

    And Raymond thanks for the tips on 'Function' and its functions..lol.. but seriously, after you had suggested to use a function I went digging through the VS manual, and there it was, together with user-defined procedures.. It seems they can be very useful. However it also looks like a bit of a mission to implement. As the examples(in the manual)suggest, they are created so they can be 'easily' retrieved later. And also as you had mentioned, it simplifies the code. From your example in of itself I can see more lines of code then Adding the surfaces one by one as your example showed(the example just before the function one). I gather that the function serves a purpose where somewhere down the line I wanted to added four other polygons I could just call that particular one (Add4Polys) and feed in the new polys? Is this correct?

    For what its worth, the two replies in this post alone have expanded my knowledge immensely and I really appreciate such help. So thanks again.

    Also on a side note.. I noticed not a lot of people post their codes up here for others to see. Is there a legal reason for this? (Like a rule for the forum?). Would be nice to have a place where we could share our codes and maybe get others to comment on it, like you guys have done, to make it better, or improve it. Does such a place exist for vectorscripting?

    Thanks again. Tui

  6. Ahh write a function.. I think thats what I want to do.. I've seen that alot in the Vectorscript Manual, but I just dont know how to implement it.

    I should say I 'just started' getting my head around scripting.. :)

    Back to the script.. there is a known number of objects to combine.. Just 4 polys.. How would I write the function script you mentioned?

    Thanks

    Tui

  7. {..script for JTopC Creation..}

    JkTopC := LNewObj;

    {..script for JkBotC Creation..}

    JkBotC := LNewObj;

    {..script for JkEndC Creation..}

    JkEndC := LNewObj;

    {JkTrAdd is a dummy handle to add surfaces}

    JkTrAdd := AddSurface(JkEndC, JkBotC, JkTopC); {Add Chords}

    I understand the AddSurface function only allows two handles to be added.. and my above scripting is incorrect.

    Is there anyway to add more than two objects in one function.. because I'm thinking that the only other way is to create another handle JkTrAdd2 and then it would be

    JkTrAdd2 := AddSurface(LNewObj, JkTopC);

    or how would I go about this?

  8. I dont have VW2013 at home so I can't really open these files. (Am on 2012 at the moment). But I will check them once am at work.

    Just a quick question did you select the option to 'Use current document's class visibilities' in the viewport class properties of the Referenced Design Layer Viewport?

  9. Hello

    I assume your meaning the WINDOOR tool by ozcad?

    Also which vectorworks version are you using?

    Not sure about the previous or latter versions, but for version 2011:

    The windoor ID's are pulled from an external file. (usually in your \library\default\windoor\IDs folder.

    if you open the file (WinDoor ID Symbols.vwx) in that location you'll see all the ID's as symbols. You can duplicate and rename the one that you want to edit; and rotate it in its symbol edit mode.

    Go back to your project file and your edited/rotated ID should show up in the list of ID's to use. Use the rotated ID.

  10. Tried that Jonathan, didn't seem to work..

    This open source script has really gotten me interested in VScript. Quite powerful. I just started playing around with it this morning.

    So I just edited the script to use our firms standard font.

    adding:

    TextFont(GetFontID('insert font name here'));

    Cheers.

    p.s is there anyway to get this to show on the Object Info Pallette? A drop down list of fonts/font styles?

  11. Greetings all,

    We've just upgraded to Vectorworks 2011, and I am currently running through the new features (as we came from a VW12.5 workflow,although having touched/gone through 2008 & 2010 evaluation versions), and was quite impressed with the idea of having now being able to put viewports on design layers.

    Straight away I thought that, now we can viewport elevation views of our model onto our design layers and annotate everything on a single design layer for each elevation (having all four elevations on one design layer side-by-side). Unfortunatley I found out that this is not possible as trying to viewport now (elevation viewports + annotations) to a sheet layer only shows the model and none of the annotations.

    Am I doing something wrong? or is this impossible?

    Thanks in advance

    Tui

  12. Hello all

    just a quick question regarding the DTM site model.

    Is there a way to set your proposed DTM site model to become your existing site model? So that everytime you update it only calculates the new site modifiers on the site and not having to recalculate each and every site modifier when we want to update the model..

    (i have many site modifiers and am further adding them - and my vw 08 keeps crashing when it reaches a certain number of modifiers)

    regards..

    2E

×
×
  • Create New...