Jump to content

Kevin McAllister

Member
  • Posts

    5,158
  • Joined

  • Last visited

Posts posted by Kevin McAllister

  1. Something more. What you actually wish is to work by includes. Easiest configuration:

    * save a textwrangler file with your script in you User/Plug-Ins folder. Use file suffix ".px" or ".vss". Please read the documentation about "Includes" for the difference. I advise you to name your text files with a suffix such as "z" because they will list in the script editor, which is boring.

    * in the plug-in editor select your tool/command, edit it

    * remove all code there, add this line {$INCLUDE z_myScript.px}. This tells the compiler to search for an include file in the same folder as the plug-in. For the compiler this could mean any of the three folders: application, user, workgroup.

    * save and close

    * now activate the compiler mode: Tools > Scripts > VS Compiler mode.

    Orso,

    Thanks for this! It greatly improves the workflow and testing.

    I am looking forward to learning more about Vectorscript as I work with it.

    Kevin

  2. Laura,

    What version of Vectorworks are you using? Do you have Renderworks installed? If the command is greyed out in the menu, it probably means that Renderworks is not installed.

    Mike, just to clarify, I believe you can only make an image prop from an image file (the file dialog opens when you choose the menu command), not from an existing resource like a texture.

    Kevin

  3. Hello Orso,

    Thanks for taking the time to read my post.

    Kevin, please also look at the Developer Wiki. It reproduces the shipped VS documentation but is more actual. Fixes are reproduced faster there. There are comments.

    I appreciate the link to this new resource. It looks like a valuable addition to the others.

    I would be careful, if I was you, in stating this. It is not true. There aren't many errors in the Vectorscript documentation. I won't exclude some errors, but wait until you have some more experience in Vectorscript before stating such a thing.

    If you have the feeling that something is erroneusly described, please file a bug report or write a warning in the VS list. Someone will take care that the error will be fixed.

    I would never state this lightly, but it is an accurate account of my experience. All have the errors I found were forwarded on to tech support as I found them.

    They were -

    The icon size for PIOs is incorrectly labelled as 24 x 18 in the Adobe Air manual. The correct size is 26 x 20. I know this because Vectorworks gave me an error message when I tried using one at the first size.

    The Num2StrF function does not return "1'-11 1/2"" as shown in the example in the Vectorscript Function Reference (the HTML file found in the Vectorworks 2010 folder). It actually returns "1'11.45" that has no dash between the feet and inches and a decimal value. I know this because I built a script using only this information and the text function and that is what it returned.

    In this example from the Adobe Air manual below entitled "Setting Parameter Values from Scripts", the second 'Space Width' actually needs to be 'Space_Width' or the value does not get passed. This was discovered by trial and error.

    BEGIN

    resultStatus:= GetCustomObjectInfo(objName,objHd,recHd,wallHd);

    IF resultStatus THEN BEGIN

    sp_width:= PSPACE_WIDTH;

    ...

    ...

    sp_width:= 5 * sp_width;

    ...

    ...

    SetRField(objHd,GetName(recHd),?Space Width?, Num2StrF(sp_width));

    END;

    END;

    This last one is not necessarily an error, but more incomplete information. Some types of PIOs generate a Parameter base on user input (ie. LineLength for a Linear Object). The manual is clear that these cannot be deleted. I was experimenting and accidentally changed its name. Because I was consistent in both the Parameter definition box and my script, the script worked, but it had lost the initial value generated by user input and instead was defaulting to the default value in the Parameter box. So by changing the original Parameter's name, I had essentially created a new Parameter. The original one still existed behind the scenes, but no longer showed up in the Parameter box. When I changed the name back in the Parameter box, it reassumed the original Parameter information.

    I guess I was just having a day of discovery....

    Kevin

  4. Yesterday I sat down with the hope of creating my first Vectorscript PIO. I had an idea for one for a while and was curious about what could be accomplished. I thought I would write a little about my experience since I have seen so many beginners asking about Vectorscript on these forums. While I am an experienced Vectorworks user, I have only dabbled with the simple scripts generated by the Custom Selection and Custom Tool dialogs. My coding experience in general is pretty limited, having done a little HTML and CSS stuff for a Continuing Education class.

    So here is a bit about the process. First I looked around for some resources -

    - I started with the Vectorworks help system. There is lots of information there but its written in a fairly dry, technical way.

    - I then went to the Nemetschek website under Support>Vectorscript. A few more resources here. I downloaded a variety of example scripts from here and waded through them. Unfortunately many are not well commented, making them a bit overwhelming. I had chosen to open the example scripts in TextWrangler, the same editor I have been using for HTML, and had a very happy discovery. TextWrangler (which is free online) happened to have highlighting for Vectorscript documents. This made it so much easier to see what was going on. I?m not sure why it doesn?t get a mention on the Nemetschek website. I later discovered there is even a language update for it from here -

    www.vectorlab.info/index.php?title=VSS_Language_Module_for_BBedit_%26_TextWrangler

    Anyway, I highly recommend TextWrangler for your first Vectorscript outing, as its much more user friendly than the editor built into Vectorworks.

    The one other thing I would suggest you read up on in Vectorworks help is the section on Parameters for PIOs. It proved invaluable for this process.

    From there I decided to jump in and see what would happen. I started by saving one of the example files under a new name as a template for script structure. I couldn?t find a basic, blank template file anywhere. Sort of odd as that was one of the first things we built when programming HTML. I started commenting the file heavily to remind myself of what I was doing, and, unlike many of the examples, I made my variable names very clear (ie. marker instead of mkr) so there was no confusion in my mind as to what was what. I trimmed the code down so all I had was the basic structure and the beginnings of some functionality.

    The next thing I did was create a new PIO in the Vectorworks Plugin Editor (Tools>Scripts> Vectorworks Plugin Editor) within Vectorworks itself. I had debated making a copy of an open source plugin as a starting point, but it turns out you can?t change the type of an existing plug in. Starting fresh was a good experience anyway as it allowed me to further learn about Parameters. Once the PIO was created I added it to my workspace. In my case I was creating a tool, so I added it to the custom palette I had created for the example tools.

    Now I was able to test my script. To do this I cut and paste from TextWrangler into the Script area of my PIO. Here I would compile and look at any errors. The error system is pretty cryptic and often tends to flag the thing after the error, not the error itself. One error may appear to be many because of the way it works. I found that starting with the first error was the key. It is always easier to edit something once you have an idea of the overall structure. I must say it was very rewarding when the script drew its first line by itself!

    Once I had some basic functionality, I added pieces bit by bit, testing as I went until I had the full functionality I wanted. The development and testing process involved a lot of cut and paste, something that TextWrangler is good at. It allows for multiple files to be open, so you can easily grab snippets from here and there. I discovered along the way that unfortunately there are many errors in the Vectorscript documentation. This is something we as beginners should be aware of. It often can be wise to ask someone with more experience when something looks like it should work but it doesn?t. I managed to muddle through using my troubleshooting instincts, but it did add a lot of tinkering time as I did.

    In the end, my goal was to create a fully functional tool so I would have experienced the entire developmental process. I even took the time to add help notes, generate custom icons and encrypt the tools. It was a great taste into the power of Vectorscript and I ended up with two functional tools. I was surprised at what I achieved given my level of experience. I invested about a day overall and it was time well spent.

    The first tool I created was Ruler Bar. In theatre, ruler bars are often placed on a light plot to aid in placing lights. I was curious to see how it could be dynamically adjusted through the use of the OIP.

    The second tool I created was Artefact Label. It was inspired by another forum thread, where someone wanted to be able to label individual artefacts on a plan and include some basic information. I was curious to see if I could populate a record using data that could be entered in the OIP. I also wanted to see if I could make it maintain its size on the page when the layer scale was changed.

    I would recommend that most regular users of Vectorworks take Vectorscript for a spin.

    Kevin

    PS. Here are the tools I created to give you an idea of how a little knowledge can turn into something cool.....

  5. So today I made my first Vectorscript PIO. I totally support better documentation and examples. What exists now is too cryptic and not designer friendly.

    I started by using example scripts from the website. These scripts need much more commenting within them if they are truly to be examples.

    I also used all the manuals available (online and in the help system). Interesting I stumbled upon an error in one of the manual examples. I only discovered it was an error after much trial and error on my part. This sort of stuff really needs to be improved upon.

    I also discovered no one should code in Vectorworks itsself. Better included coding tools are needed. I used a program called TextWrangler, which I also use for coding HTML. Thankfully it colour codes and cleans up some of the code, making it much easier to see what's going on.

    My two cents.

    Kevin

  6. Ted,

    If you delete most of the items out of a test file, the conflict is most likely in a symbol. When you do the round trip from Vectorworks to Autocad and back, many things come back in a symbols often nested in other symbols. I suspect you'll probably find your conflict somewhere in the Resource Browser items.

    Kevin

  7. You can also download and use Print to PDF which is a shareware utility available for earlier versions of OS X.

    You may want to consider adding a signature to your profile that includes your version of Vectorworks, operating system and computer....

    Kevin

  8. Steve,

    There's your problem.... you need to use File>Import>Import PDF not File>Import>Import Image File. If you use Import Image File, Vectorworks converts your PDF to a raster image and discards the vector information. You also lose the ability to snap to it.

    Kevin

  9. With your first try, using hidden line and the mesh object, did you set the SLVP Smoothing Angle to something greater than 0 degrees? It can be set by clicking Background Render Settings. You'll have to experiment a bit to find the right setting. Anything up to about 30 degrees tends to work well.

    Kevin

  10. It should work based on my own experience. I've referenced in items for other files and included them in sections.

    Is there a way to strip the files down enough to post them (ie. replace your geometry with some simple proxy objects) so we can see the referencing?

    Kevin

  11. It sounds like the Class containing the referenced DLVP may be turned off in the Sheet Layer Viewport for the section.

    Out of curiosity, are there both Screen Plane and Layer Plane objects in the reference along with 3D objects?

    Kevin

  12. It is possible with a Mighty Mouse. I know because it used to be my setup. I think the ball needs to be set to third button (or middle button) in the system preferences for the mouse. I can't test it at the moment as I'm using a Magic Mouse....

    Kevin

  13. Hi Will,

    Thanks for the file. Is this the one that shows a twist? Or is this the fixed version? It shows up correctly in VW2010.

    It makes more sense now that there are so many slices, as its not really curved so much as facetted. I think I would have built it as two pieces, the straight bottom half and the facetted top half, allowing me to reduce the the number of slices in the bottom half to two.

    Benson, I had the same result as you when I started making a version using circles and clip surface, spinning beach ball. I think its because my 3D conversion for curves is set to very high. Will's version has a fixed number of points in the flutes, whereas the number of points in ours changes as the 3D conversion factor is changed.

    If you can make a version with the loft rail command it probably actually is more efficient. My experience has been the NURBs can help the efficiency of a file.

    Kevin

  14. Can you post an example file? I'm not sure I entirely understand the shape if it requires so many polygons.

    When I've had trouble with multiple extrudes, I've made smaller segments and then used the Add Solids to combine the pieces. It allows you to retain the history and tends to cause less problems.

    Kevin

  15. Ok, so I thought they were resetting themselves because of something I was doing, even though it seems a little random. Perhaps there is a bug here, but I am not sure how to reproduce it consistently.

    Its still a mystery where their default values come from.

    Kevin

  16. Does anyone know what sets the default line weight and dash style for a section line. They don't seem to relate to the defaults in the Attributes palette. I often assign them to a specific class and set the attributes to by class, but I have to do it manually afterwards. And if you adjust the section line the attributes reset themselves...

    Kevin

×
×
  • Create New...