Jump to content

Alexandre Villares

  • Content Count

  • Joined

  • Last visited

Posts posted by Alexandre Villares

  1. I used the {*} and {---} to highlight the different parts of the script, as there is no TAB indentation available on this web-based board, you can remove them!

    Things between { } are 'comments' with no influence on the code.

    About the procedure difinition structure:

    Procedure MainProgram;{Declare your variables}VARX: REAL; {example}(...)

    {Define your subroutine here}Procedure MySubProcedure;VAR(...)BEGIN(...)END;

    {start your Main Procedure here}BEGIN (...) {your main program here}END;

    Run (MainProgram);

  2. Hi Jeff,

    Handles are special data structures that serve as unique identifiers to objects in a VW file.

    This is a bit tricky, but have a look:First I define a new function called SetMyInfo, then I ask VW to apply it to each drawing object that complies w. the criteria (S='...'). This is a special procedure (FEO-ForEachObject) that passes a handle to SetMyInfo.

    {*}Procedure SetTest; {---}Procedure SetMyInfo(ObjHandle:HANDLE);{---}BEGIN{---}SetRField(ObjHandle,'TitleBlockInfo','DrawingDescription','ProdLayout'); {---}END;{*}BEGIN{*}ForEachObject(SetMyInfo,(S='TitleBlock'));{*}END;Run(SetTest);

    [ 05-12-2002: Message edited by: Alexandre B A Villares ]

  3. update: Ops, it seems it put the wrong title to this message, it's the v9 that has the corrupted workspace.


    The package available for download at ?http://www.nemetschek.net/support/custom/vscript/vstool.html? seems to be corrupted.

    The Mac workspace has only 48 bytes. Please have a look.


    [ 04-19-2002: Message edited by: Alexandre B A Villares ]

  4. As far as I understand, If you want to put a number into a single cell you can do this:

    wsHandle:=GetObject('WorksheetName'); IF wsHandle <>NIL THEN SetWSCellFormula ( wsHandle, Row , Column , Row ,Column, Num2Str(0,Value) ) ;

    Note Row & Columm parameters are used twice, and the Value variable is converted to a string.

  5. These scripts *do* work, but they do not update the classes pop-up menu. If you check the Classes... panel you'll see they actually did their job.

    But then again... you can add some code:VSave('%DummyRefreshMenuSheet%');VRestore(''%DummyRefreshMenuSheet%');VDelete(''%DummyRefreshMenuSheet%');


  6. For the script editor:

    • Find and Replace
      Syntax coloring (or a more dynamic link to an external editor like BBedit)
      Standard Pascal/VS keywords in the procedure menu
      Key-in-the-first-letter to search the procedure menu

    For the workspace editor:

    • drag & drop of multiple selection of plug-ins (i.e. drag a whole category to create a whole palette at once)

    More code examples:

    • the new path PIOs have Path *and* Profile
      File I/O code example
      3D Path Object
      Path Objects path replacement
      [update: event aware objects examples]

    New Procedures:

    • Procedure that would call a command's parameter dialog
      [update: there seems to be a 'event aware' class of calls that could let one create a custom preferences panel]
      Procedures to read/alter classes and layers inside standards


    • Searchable archives for the NNA VScript-List
      [update: the VS-List now has archives!]
      Paste as VectorScript: copy some objects and paste their script descriptions inside the script editor...

    [Wink] A

    [ 07-26-2004, 09:02 AM: Message edited by: Alexandre B A Villares ]

  7. Note you can use the VW9 Demo version for script development.

    The Demo version won't save, print or export VectorWorks drawing documents, but as far as I remember it can edit and save changes to any unlocked (unencripted) Plug-in objects.

    Organise Menu->Create Plug-in... will edit files (.vss; .vsm; .vst; ...) found inside the Plug-ins folder.

  8. Mark, you should try the "standards" feature:

    Make a file with all the classes you need (your template for example) and put it inside the folder named "Standards".

    After the purge, open the "Classes..." panel and ask to create a new class. Choose the "create classes from standards" radio button, select your standards file.

    Now you can control-click to select and re-create all your standard classes at once.



    PS: I have a wish / script idea that goes the oposite direction, I would like to have a "purge by standards" command that would remove classes not on some predefined standards (it could pass all the objects on those classes to a 'purged' calls). I wrote more about this idea at the vectorscript part of this board.

  9. When I add a parameter (any parameter) to this custom tool plug-in it stops working...

    Note it calls for the creation of a PIO, and as a parameter is created for the tool, the PIO stops being created.

    I've tried to add a getclass-setclass PIO reset but it didn't work.


    ---axis-line.vst:Procedure AxisLine;VAR h, m, Waldo: HANDLE; px,py: REAL;BEGIN PushAttrs; NameClass('axis'); PenColorbyClass; LSbyClass; LWbyClass; Locus(0,0); Waldo:=Lnewobj; CallTool(-201); {line tool} h:= nextobj(waldo); delobject(waldo); Get2DPt(h,2, px,py); {line's second point} PopAttrs; m:=CreateCustomObject('axis-label',px,py,#0d);END; {create an instance of PIO 'axis-label' }Run(AxisLine);---axis-label.vso:Procedure AxisLabel;BEGIN PenColorbyClass; Arc(-0.125,0.125,0.125,-0.125,#360d,#360d);END;Run(AxisLabel);---(VW 9.5 on a mac)

  10. Training people to use VectorWorks for some time now, I think that some small things could improve user understanding of it's working logic even without creating any new functionality.

    The Organise/Edit Group menu command already changes to 'Edit Symbol' depending on context, so I wish it would show 'Edit Extrude', 'Edit Floor', 'Edit Solid Subtraction', etc. (at least it could change to 'Edit Object')

    The 'edit' contextual menu will bring the reshape tool when applied to poligons or polylines, that's great, and I wish the Organise/Edit menu slot would act accordingly.

    Last, the 'ungroup' command could become 'unmake' when applied to plug-ins and other high-level objects.

    [ 02-09-2002: Message edited by: Alexandre B A Villares ]

  11. I think this wouldn't be too hard to script and maybe with the help of people here I could do it myself.

    A command that would look inside certain standard files(on the standards folder) and delete any classes on the document that do not conform to the standards.

    Extra: The objects on these classes could be moved not to 'none' but to a 'purged' class.

    steps:1- panel asks user which standards to use2- read standards and create a class list.3- compare actual classes to list and remove non matching classes

    Would you find this useful?(Think of importing messy dwg files)Feedback please!

  12. If I get it right, VectorWorks plug-in architecture is so that if you make a script that doesn't need user interaction you should call it "a command" and put it in a menu.

    Real "tools" as well as PIOs need some clicking and shall be put on palettes...

    Now, I wish I could put some layer options switching commands on a palette (I have even designed some very nifty icons representing "gray others", "show/snap others" and all that stuff).

    Is there something I can do? a way to make a tool be clicked and go away?

  13. >>2) I should be able to move an element or selection>>set on the screen according to any vector that I define >>with two mouse clicks (whether or not those mouse >>clicks are on the selection set).[...]>Go to http://www.vectordepot.com and get the >move/duplicate by vector plug-ins, >they'll do exactly that.[...]

    The move/duplicate by vector plug-ins at Vector Depot work great, but for those inclined to a quick workaround:

    1- Create a 2D locus at the first point of the line vector;2- Select the object you want to move (keeping the locus selected) ;3- Move the locus, deselect all, remove the locus.


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...