Jump to content

Miguel Barrera

  • Content Count

  • Joined

  • Last visited

Community Reputation

11 Good

1 Follower

About Miguel Barrera

  • Rank
    500 Club

Personal Information

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

Recent Profile Visitors

1,971 profile views
  1. Miguel Barrera

    Use marionette to create parameters on object

    yes you can change the popup item list with vectorscript. see below for more info: Custom Shape Pane Popup However, the plugin has to be event enabled to update the popup after each interaction in the object info.
  2. Miguel Barrera

    VW12.5 how to select text

    I am glad that it helped you
  3. Miguel Barrera

    Updating Record from Excel Spreadsheet

    First you have to make the ODBC connection in your system with an odbc administrator. I have windows so the following step will be different in a Mac. 1. Open odbcad32.exe located in C:\WINDOWS\syswow64. 2. Create a User DSN or System DSN and click Add 3. Select the driver for the database and click finish. There are a select number of MS drivers including excel files that ship with windows. 4. The following dialog will vary depending on the driver chosen. For databases, it will have connection options such as user name and password but for excel files, you just need to select the spreadsheet. Enter the Data Source Name, which is the database name that VW will see, and click OK. In VW 1. Click on the menu Tools->Database-> Manage Databases... 2. In the next dialog, click on Connect 3. Under Use Data Source Name, the system ODBC that was created above should appear in the drop down list. Select the DSN and click OK. The following is a vectorscript snippet that shows how I get the connection. It looks for a connection in VW first and if not available, it will connect directly to the system ODBC. dataName:= kDB_DATANAME; tablName:= kDB_TABLNAME; InitODBC(dataName,tablName,hdrName); shtData.sqlQry:= ''; shtData.sqlQry:= Concat(shtData.sqlQry,'SELECT * FROM ',tablName); shtData.sqlQry:= Concat(shtData.sqlQry,' WHERE '); shtData.sqlQry:= Concat(shtData.sqlQry,hdrName.primarySt,' LIKE ''%',shtData.st1Lt,'%'''); shtData.sqlQry:= Concat(shtData.sqlQry,' OR '); shtData.sqlQry:= Concat(shtData.sqlQry,hdrName.secondStr,' LIKE ''%',shtData.st1Lt,'%'''); WriteLn(shtData.sqlQry); foundDB:= FALSE; IF DBDocGetDB(dbConnList) THEN BEGIN IF DBSQLExecute(dataName,shtData.sqlQry,colTot,resSetInst) THEN BEGIN ProcessRecs; foundDB:= TRUE; END ELSE IF DBSQLExecuteError(errMsg,errState,errCode,intDesc) THEN WriteLn(errMsg,', Code = ',errCode); END ELSE IF DBSQLExecuteDSN(dataName,kDB_USERNAME,kDB_PASSWORD,shtData.sqlQry,colTot,resSetInst) THEN BEGIN ProcessRecs; foundDB:= TRUE; END ELSE IF DBSQLExecuteError(errMsg,errState,errCode,intDesc) THEN WriteLn(errMsg,', Code = ',errCode);
  4. Miguel Barrera

    Updating Record from Excel Spreadsheet

    You can link an excel file to vectorworks with ODBC. I use the connection to fill-in fields with vectorscript in a form based on a user selection. However, the primary function of the ODBC connection is to link the database (excel file in this case) to Vectorwork objects with a common key field and it seems that is exactly what you are trying to do.
  5. Miguel Barrera

    Date function - data structure changed in 2019?

    Are there any examples of how to add python routines into vectorscript?
  6. 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
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. Miguel Barrera

    PIO retaining state & Parameter Default Values

    developer mode is in the Vectorworks Preferences->Session->Run scripts in developer mode
  12. 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.
  13. 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.
  14. 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.
  15. Miguel Barrera

    Parameter ID's...

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


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.