Jump to content

Miguel Barrera

Member
  • Content Count

    634
  • 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,454 profile views
  1. 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.
  2. 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.
  3. 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.
  4. Miguel Barrera

    PIO retaining state & Parameter Default Values

    developer mode is in the Vectorworks Preferences->Session->Run scripts in developer mode
  5. 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.
  6. 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.
  7. 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.
  8. Miguel Barrera

    Parameter ID's...

    you can if the plug-in is event enabled and you assigned the ids manually during the setup event.
  9. 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. 😉
  10. 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.
  11. 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.
  12. 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.
  13. And if you are creating a hybrid (2D/3D) object, you can use GetSymLoc3D() to find the z location of the object's origin. If the document's page center is other than (0,0) you will also need GetOriginInDocUnits() which should be added to GetSymLoc to get the correct coordinates.
  14. Miguel Barrera

    return index of pop-up in PIO

    try: FUNCTION GetPluginChoiceIndex( inPluginName :STRING; inParameterName :STRING; inChoiceName :STRING; VAR outIndex :INTEGER) : BOOLEAN;
  15. Miguel Barrera

    Export drawing into text format.

    My question would be why do you even want to export to excel in the first place? If it is for some kind of mathematical analysis, then why not do it in VW with scripts?
×