Jump to content

MaxStudio

Member
  • Posts

    319
  • Joined

  • Last visited

Posts posted by MaxStudio

  1. I've been scripting with vectorscript for a while but, I'm new to python.

    in vectorscript I would retrieve a parameter from the OIP as follows:

    LineLength:=PLINELENGTH;

    How do I go about this in python?

    If possible, could someone provide me with a simple example of creating a rectangular plugin object that allows me to change the Width & Height of the rectangle via the OIP?

    Is python meant to phase out vectorscript completely in the future?

    Thank you

    Derek

  2. Hey thanks for the great suggestion guys. I was really hoping there was a quick way to reference a point on a wall, type in a distance i could lock and then draw a new wall offset from there. I believe Jim's suggestion is the closest to what I was looking for.

  3. Item is an integer that can be 1,2,3,4,5 or 6

    If I want items 1 through 3 and item 6 to do the same thing how can I write that?

    I know I can use 1..3 for items 1 through 3, but how do I also include item 6 so i can condense the following code?

    CASE item OF
    
    1..3: BEGIN
        { do procedure A }
    END;
    
    4..5: BEGIN
       { do procedure B }
    END;
    
    6: BEGIN
       { do procedure A }
    END;
    
    END;

    Thanks

  4. If I print and then attempt to save Vectorworks crashes... does anyone else have this issue? This is not a new issue... I've just been dealing with it for a long time.

    Mac OSX 10.5.8

    VW 2008 SP3 (Build 88670)

    Plotter: Canon iPF755 Version 1.20

    Thanks,

    Derek

  5. Raymond,

    Thank you, I was originally using Num2StrF(). Your suggestion to use Num2Str() has solved my problem.

    Marteen,

    I attempted to convert the real to an integer first and it remained in the dimension form.

    Jonathan,

    The fields I'm using to do the calculations are Dimensions. The field I'm using to display my calculation is Static Text. Therefor, I needed a way to convert the dimension to a real number.

    Derek

  6. I have a variable that I want to display in the object info palette.

    For instance, the value of the variable is 9.

    I set up a static text and use a setfield to display the 9 in the OIP. For some reason the 9 is displayed as 9" rather than 9. If I change the variable to 12 it displays 1'-0". How do I get it to display 12 instead of 1'-0"?

    Thanks,

    Derek

  7. Pat,

    I tried this and it sort of worked. The problem is it only work if I changed the note from the worksheet. Also, when I changed the worksheet it did not update the symbols until I selected one, chose edit 2d symbol and then clicked ok. After that they all updated.

    Unfortunately, it wouldn't update the note or tags from the Data tab on the OIP.

    I'll check the manual to see if I can come up with a solution.

    Josh, how do i go about making a button event?

  8. I want to be able to create a PIO that works like a symbol, but I only want to create one plugin tool to create these PIO.

    one plugin tool that creates the multiple PIOs.

    "This is PIO 1" , "This is PIO 2", "This is PIO 3"

    I want to be able to select "This is PIO 1" and duplicate. (I can accomplish)

    I then want to change the text of "This is PIO 1" to "This is the NEW PIO 1" (I can accomplish)

    (the part I don't understand how to accomplish)

    Once I change "This is PIO 1" to "This is the NEW PIO 1" I want it to change all the instances of "This is PIO 1" to "This is the NEW PIO 1".

    I've tried having the plugin object create a symbol, but once it becomes a symbol it loses it's plugin object abilities.

    My only other solution might be to create a way to tag each plugin... Create another Variable to Label them... I was hoping to use the text "This is PIO 1" as the Label and the String of text created.

    I hope that makes sense to you. BTW, I'm not sure if I'm trying to reinvent the wheel. I just want a tool that makes it easy for me to create notes... when I change the one instance of the note they all change. I just don't want to have to double click and go into a symbol to accomplish this.

  9. I was planning on creating a plugin object to do the following...

    Create a some text that is converted to a symbol.

    I want to duplicate that symbol.

    I want to be able to edit the text of the symbol via the Object Info Palette and have it change all the instances of the symbol.

    Is this possible? Would it be better/easier to create a plugin object that references a worksheet?

    Thanks

    Derek

  10. "Too many files open"

    Are we limited to the number of include files I can use in a script?

    My script uses, at the moment, a total of 19 included .px files.

    I received the message above after trying to compile my script.

    I removed 1 of the .px files and included the script in one of the other 18 files. The script then compiled correctly.

    Has anyone ran into this problem or know of a work around?

    Thanks

    Derek

  11. When I change the units in my drawings my plugin object changes size. I realize this is because I never specified the units in my script. how do I declare a variable as inches or feet?

    my width and height are:

    width:=4;

    height:=6;

    when my document is set to 'feet and inches' it draws it correctly; a rectangle that is 4" x 6"

    but when I change my units to 'feet' it draws a rectangle that is 4' x 6'

    how do I write the script so the rectangle remains 4" x 6" even when my units is changed to feet?

    width:=4";

    or

    width:=4in;

    Thanks in advance

    Derek

  12. Hey! I did what you suggested and got the information to come over.

    1. I kept the original worksheet in FileB.

    2. I referenced FileA along with the Layers I that were associated with the schedule database information.

    3. My criteria now allowed me to include those referenced Layers from FileA.

    4. I set up the criteria correctly and once i Updated and Recalculated the information arrived.

    So it works, but I am unable to edit the referenced database information in FileB. The information is locked (grayed).

    Thanks everyone for your help!

  13. Lets say I'm trying to reference WorksheetA (from FileA) into FileB. While FileB is active I will choose FileA in the resource browser and right click the WorksheetA resource. It will allow me to import the worksheet, but the "reference" option is grayed out. If I import the worksheet it will not be imported with any database information from FileA.

    (notice how 'Reference' is grayed out)

    XMo56y9.png

    So I tried an alternative route. I tried setting up a reference to WorksheetA through the "Organization" menu. In FileB I go to Organization>References. I click New and Add FileA to my reference list.

    Then in FileB I create a new Viewport. The Viewport "source" is existing reference file "FileA" I choose the layer that WorksheetA is on and click 'OK'

    A viewport is created in FileB. It shows WorksheetA but does not include any database information.

    This is what WorkSheetA looks like in FileA (notice the database information it contains)

    1ZZd5DL.png

    This is what WorksheetA looks like when in FileB (notice there is no database information. I am trying to get that information to carry over from FileA to FileB)

    EXku5tI.png

    I would like to have the Worksheet and its information available on a separate file. I know I could export it, but I wouldn't be able to have the ability to update the Worksheet through the reference so I would have to export it each time there is a change.

    Any ideas?

    Thanks for your help

  14. yes I was definitely missing the point. I finally got it working using the process above. I'm pretty excited about this because in the past I had to place the include files on each computer I wanted to run the script on. Now I only have to copy the one plugin file.

    Thanks again for your guidance. It is very much appreciated.

  15. ok i think i may have figured out an alternative way to encrypt the script.

    1. I set up the parameters as in Image01.

    2. In the script editor (Image02) I paste the code from CreateRectangle.px and compile the script.

    3. If everything go well I close the Plugin Editor and test the plugin.

    4. If it works, I open up the Plugin Editor a 2nd time and highlight my plugin 'CreateRectangle'

    5. I click and hold the following button combination:

    Caps Lock+Shift+Option+Command

    and click the script button twice. It locks my script and I can no longer edit it.

    6. I shutdown vectorworks.

    7. I moved the 'draw.px' file to a new location (to test that the plugin no longer needed to access the file.)

    8. I restart vectorworks and test my plugin. It's still working without the 'draw.px' file.

    That seems to work. Does anyone know anything wrong with this process? Does it give me the same result as using the "Encrypt VectorScript" menu option?

×
×
  • Create New...