Jump to content

Miguel Barrera

  • Content Count

  • Joined

  • Last visited

Community Reputation

8 Neutral

1 Follower

About Miguel Barrera

  • Rank
    500 Club

Personal Information

  • Occupation
    Civil Engineer
  • Hobbies
    computer programming
  • Location
    San Antonio, TX

Recent Profile Visitors

1,788 profile views
  1. Miguel Barrera

    Date function - data structure changed in 2019?

    Are there any examples of how to add python routines into vectorscript?
  2. Miguel Barrera

    worksheet function

    You can get the volume and then divide it by the height of the slab to give you the surface area. You just need to check for the unit of measure returned by the functions
  3. Miguel Barrera

    Tracking PIO movement

    Another way to structure the pio is to have the pio origin at the object it is connected to and have the control point as the moving part of the pio.
  4. Miguel Barrera

    Has the Path changed, lengthened or shortened

    Just the fact that you changed the object, it should call the regeneration code. To test whether the length has changed, you could store the last value in a hidden parameter and then compare to the new length.
  5. Miguel Barrera

    PDF Export, ResetObject

    In your code above, the reset to each object in the loop will happen only after the DoMenuTextByName call or the last line of code.
  6. Miguel Barrera

    PDF Export, ResetObject

    The problem with resetting the plugin is that the code has to complete before it actually gets reset. It does not happen immediately when it is called. What I do is set a hidden Boolean parameter to true on the first reset event. When the pio goes through the second reset event, it will encountered the true value and execute the code in question and then I will set the parameter back to false.
  7. Miguel Barrera

    PIO retaining state & Parameter Default Values

    developer mode is in the Vectorworks Preferences->Session->Run scripts in developer mode
  8. Miguel Barrera

    PIO retaining state & Parameter Default Values

    My own experience is to change values in the reset event. the typical work flow is : assign parameter values (either default or user entered) to variables with the P value or GetRField. find which parameter has changed and update any other variables as needed. redraw the plugin with the new values. assign the variables to the corresponding parameters at the end of the reset procedure with SeRField. If I see that some value is not changing when it is supposed to I will turn on the debugger and trace the value in question to find out why it is not changing. I work exclusively in vscript because the debugger is readily available. I have tried to setup the debugger in python but with no success and is the main reason I have not jumped into python. If you can get the debugger to work for you, it will help you a lot in finding any bugs in your code.
  9. Miguel Barrera

    Parameter ID's...

    Sorry, I got this confused with added buttons where you do assign your own ids. But knowing that parameter ids start at 1 and are added sequentially you can still loop these values. For the second grouping, you could add 100 or any other number to the parameter ids.
  10. Miguel Barrera

    PIO retaining state & Parameter Default Values

    I would think that they get assigned on the first event because they are available for setting up popup menus, parameter visibility, and any buttons clicked. If I need to change any value I will do it during the reset value with SetRField.
  11. Miguel Barrera

    Parameter ID's...

    you can if the plug-in is event enabled and you assigned the ids manually during the setup event.
  12. Miguel Barrera

    Script for fill of different color

    You can also find the function reference at http://developer.vectorworks.net/index.php/VS:Function_Reference for the correct spelling if you have not memorized all of them. 😉
  13. Miguel Barrera

    Script for fill of different color

    it should actually be SetFillBack(h,0,0,0) for black color. You also need to be careful with the scope of the IF statement. The IF statement should be formatted as: IF (oldLW = 2) OR (oldLW = 5) OR (oldLW = 7) OR (oldLW = 10) OR (oldLW = 14) OR (oldLW = 20) THEN BEGIN SetFPat(h,1); SetFillBack(h,0,0,0); SetOpacity(h,50); END; The BEGIN and END calls are required to mark the start and end of the IF statement. Otherwise if you omit it as shown in your previous script: IF (oldLW = 2) OR (oldLW = 5) OR (oldLW = 7) OR (oldLW = 10) OR (oldLW = 14) OR (oldLW = 20) THEN SetLW(h, newWeight); SetPenFore(h, 0,0,0); SetFPat(H1,0) [zero]; SetFillBack(h,0,0,0); Only the SetLW procedure will be executed under the IF statement. All the other procedures following will be executed for all objects.
  14. Miguel Barrera

    Script for fill of different color

    You will need to add the following 2 procedures after SetPenFore(h, 65535,0,0): SetFPat(h,1); SetFillBack(h, 65535, 0, 0); {Red fill color} If you need to find the RGB color value other than red, create a rectangle with the attributes that you want in a blank document. Export the file to Vectorscript and you will find in this text file that the attributes are listed prior to the creation of the rectangle.
  15. Miguel Barrera

    Worksheet Area Totals

    if your first worksheets has the total, you can reference that cell into the second worksheet that only contains totals.


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.