Jump to content

Alexandre Villares

Member
  • Content Count

    253
  • Joined

  • Last visited

Posts posted by Alexandre Villares


  1. Originally posted by propstuff:

    quote:

    Scripts created at the Plug-in editor, Plug-in Objects or PIOs (.vso) , Menu Commands (.vsm) and Tools (.vst) will have to be added to the Workspace.


    I realise this is needed for them to work, but given the "development cycle" involved in my first script recently, I can picture a VW Plug-ins folder littered with the wreckage of mangled PIOs before I get things to function. (not to mention the tedium of adding the plug-in and changing the workspace every time I make an edit!)

    No! It's OK to have some testing stuff in your Plug-ins folder. And you don't have to add many of them to the workspace, one will do. Let's imagine an example:

    1. You create a VSO PIO called AA_Test.vso (AA_ will make it to the top of the list), put some draft code inside it and add it to the workspace.

    2. Try to insert it on a drawing. It may work, it may not.

    3. Edit it. If you feel like it you can duplicate it before you change it (so you can go back if you break something). But you don't need to add each test to the workspace, change and test the same one.

    quote:

    What I was thinking of was my first script, which used a lot of rigmarole to draw a polyline. In a PIO this would all be taken care of by GetCustomPath (I think it is).

    But this call won't run in a Document VS because it needs the PIO "wrapper" (as it's described as in the manual) to function properly.

    How then, would I run and debug a PIO script with one of these types of calls in it?


    Do as explained before...

    Beware path PIOs are a bit tricky (you actually have to copy or redraw the user given path).

    Now includes are not so difficult, it's just a piece of code, a text file, that is included in the main code, and so can be edited outside VectorWorks.

    I'll see if I can find something for you on the include cache (so you can edit the code and see the changes in the PIO behavior immediatly).

    best rgrds,

    Alexandre


  2. Hi Propstuff,

    Adding to Petri?s wise words.

    Scripts created at the Resource Browser, or document scripts, will appear in small palettes called command palettes (Menu Window>Your Document>Command Palette). They will run when you double-click them.

    Scripts created at the Plug-in editor, Plug-in Objects or PIOs (.vso) , Menu Commands (.vsm) and Tools (.vst) will have to be added to the Workspace.

    HTH,

    Alexandre


  3. Sauda??es Pixel2!

    For 3D work I think you will find the numeric keypad a lot easier than the UCS for creating frontal and lateral extrudes right away. 3D working planes are there but I never really needed them.

    For rotaded 2D drawing, there is really no equivalent... try this:

    1. Change the grid angle and use the Datum as Katie proposed. Angled extention line alignements and snap to edge contraint can be useful too.

    2. Draw unrotaded, create a Symbol, insert a rotated instance of the symbol where you need. Double-click the Symbol instance to edit it.

    3. Draw unrotaded, create a new layer, create a Layer Link, unlock and rotate it.


  4. Hi Kiwi,

    I am doing cross platform encryption without trouble.

    Wouldn't you be switching between VW10 and VW1.5 on the different platforms?

    (VW 10 won't reconise a VW10.5 VS, and after you alter a plug-in on VW10.5 it is automatically 'converted')


  5. Salut Sylvain!

    I guess this post of mine won't be of much help, I just felt like sharing my frustration as I have been stuck with this problem once.

    I think there is no vectorscript equivalent of the duplicate along path tool.

    Maybe the SDK programming API can reproduce the 'along line' constraint (snap) functionality...


  6. 1- Do you really need the ungrouping?

    (Couldn't you just export things as they are?)

    2- I think there is no way to test the menu status, try to find out if there are any groups left before calling the ungroup.

    3- Use a ForEachObject procedure to do the ungrouping and make it work only on groups. (Have a good look at the function reference documention and example scripts at NNA's customization pages)


  7. quote:

    Originally posted by Cloud Hidden:

    It seems as though hextrude assumes that you're working in top view. If you're in front or side views, hextrude extrudes differently than calling the Extrude menu command, which recognizes the view. That doesn't make sense to me. It's not always convenient to use the menu command in a script, but hextrude isn't doing what I need. Is this in fact true? Is this the way it's supposed to be? Does it still work this way in VW11? Can you think of a convenient workaround to extrude an object created in front/side view?

    Hi,

    I don?t see why it should be different from the traditional BeginXtrd/EndXtrd procedures that make you rotate your extrude afterwards (it ignores view state).

    code:

    BeginXtrd(0,W);	

    ClosePoly;

    Poly(0,0, E,E, L-E,E, L,0 );

    Poly(0,A, E,A-E, L-E,A-E, L,A );

    Poly(0,0, E,E, E,A-E, 0,A );

    Poly(L,0, L-E,E, L-E,A-E, L,A );

    EndXtrd;

    H:=LNewObj;

    Set3DRot(H,90,0,0,0,0,0);

    Move3DObj(H, X, W+Y, Z);
    [/code]


  8. 1/ Often when trying things I get a "cannot use a Function here" message, but I don't really understand the practical difference between a Function and a Procedure.

    A procedure just does something, like SetSelect in SetSelect(g);

    A function will ?return? a value, like LObject

    in g:= LObject;

    2/ In the script I've succesfully used the LNewObject, but I don't understand why it's not working at the end here.

    DoMenuByText calls usually create objects outside the vectorscript expected order. They are considered sort of last resort ways of doing things.

    If you could manage to identify your objects two-by-two you might use a normal vectorscript procedure to do the add surface, but it would be a hell of a trouble.

    4/Ive used the (Shift) call in the WHILE loop so that I could place any number of symbols. What I really wanted, though, was to click for n times and then double-click to finish like a normal polyline, but I couldn't find a double-click call.

    The other thought I had was to Get the last click and the previous click locations, and make the WHILE loop conditional on them not being the same.

    (but I couldn't work it out, so I went the easy way!)

    Thoughts?

    Careful, I think Shift doesn't work the same from Mac to PC

    5/ The last thing I want to do is Group the whole lot, but if I use SelectAll it picks up everything in the layer.

    What can I use to select only whats been produced "inside" the script?

    Have you tried BeginGroup; as you start and EndGroup; at the end?


  9. In my experience Plug-In Objects (PIOs) can be a little bit heavy, but not always.

    And this needn't be an either or thing, you can:

    1. Turn off the 3D or the 3D detail of a PIO.

    2. Create a symbol with a PIO inside, so the repeated instances are are instaces of the same symbol (and also do 1. turn the 3D off)

    3. You can ajust a PIO to your needs and 'explode it' by ungrouping it (once in 2D, then ungroup a copy in 3D) and then pick the pieces to make your own hybrid (2D/3D) symbol. You can even delete unwanted details.


  10. quote:

    Originally posted by ApocHalyptic:

    1. When drafting 2D, it would be nice to simply 'fill' a closed area as per any paint/illustration program. Yes I understand the argument about needing a plane to apply a surface feature, but I would like straight forward simple no fuss "Fill". Not asking for PS or Ill here.


    Hi,

    Try Tool > Combine into Surface ...

    cheers!


  11. quote:

    Originally posted by Fozz:

    Question

    Is the LayerRef function supposed to do the same thing as the menu command (ignoring projecting of 2D objects)?

    Hi Fozz,

    The menu command creates a LayerRef link object (like the LayerRef procedure) then, afterwards, it moves up each LayerRef object according to the Z information of the layer it references (and locks them). Remember the LayerLink Zs are not updated automatically if you change a Layer Z after it was created...

    If you add a move and lock procedure to your script you'll be able to mimic the menu command.

    HTH

    [ 01-08-2004, 06:24 AM: Message edited by: Alexandre B A Villares ]


  12. Do you mean like the sub-menu behavior you get when you name a Class like 'name-subname-thirdname'?

    No there is no such thing for Layers, perhaps because they represent a different organising idea:

    They are not alphabeticaly sorted like classes so you can change their order using the up/down/bot/top buttons at the Layers panel.

 

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