Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Gonda

  • Rank

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi All, So, I'm running into a bit of an issue with Spotlight's Data Cable Worksheet. Apparently, the option to include the 'End Label Text' in the worksheet generation doesn't exist. I figured it would be fairly trivial to write a python script to crawl all Data Cable Objects in the drawing and read the 'Start Label Text' & 'End Label Text' fields and write them into the 'User Field 1' & 'User Field 2' fields. The following code accomplishes this for a lighting device: import vs def xyz(current_light): xypoint = vs.GetSymLoc(current_light) zpoint = vs.Get3DCntr(current_light) vs.SetRField(current_light,'Lighting Device','User Field 7',str('{:.3f}'.format(xypoint[0]/12)) + "'") vs.SetRField(current_light,'Lighting Device','User Field 8',str('{:.3f}'.format(xypoint[1]/12)) + "'") vs.SetRField(current_light,'Lighting Device','User Field 9',str('{:.3f}'.format(zpoint[1]/12)) + "'"); vs.ForEachObject(xyz,"INSYMBOL & (PON='Lighting Device')"); I adapted this code as follows to try to get it to work for a Data Cable: import vs def label2user(current_cable): start = vs.GetRField(current_cable,'Data Cable VW','Start Label Text') end = vs.GetRField(current_cable,'Data Cable VW','End Label Text') vs.SetRField(current_cable,'Data Cable VW','Rack ID',"barf") vs.SetRField(current_cable,'Data Cable VW','Box ID',str(end)) vs.ForEachObject(label2user,"INSYMBOL & INVIEWPORT & (PON='Data Cable VW')"); Unfortunately, the second chunk of code doesn't work. I have verified by inserting a vs.AlrtDialog() into the code that it is properly reading the values from each Data Cable Object. Unfortunately, the vs.SetRField() commands seems to fail. I have also tried to write to other fields but the same results keep occurring. Anyone have any thoughts? Cheers, -gonda
  2. Has anyone else successfully gotten VW2019 to log in to the cloud services? I'm on Windows 10 Build 17134 and whenever I try to select the Login/Sign Up menu option, I get the following dumper to the Vectorworks Services Log File: Traceback (most recent call last): File "Vectorworks Cloud Services.py", line 5, in <module> File "DCC.pyc", line 9, in <module> File "PySide\QtGui.pyc", line 12, in <module> File "PySide\QtGui.pyc", line 10, in __load ImportError: DLL load failed: The operating system cannot run %1. Cheers, -gonda
  3. I'm trying to set the values each time an object is inserted -g
  4. So, I tried doing this with states....i.e. a variable is defined and checked to see if it had been changed from an initial value but it doesn't seem that the plugin retains the state of set variables between events...or am I missing something?
  5. @JBenghiat So, what I was envisioning is that when you click on the tool's icon, a dialog is presented to ask for some initial values (this is a whole other issue of getting it to appear every time). The plug-in then uses these answers to set some initial values for parameters for when the plug-in is first inserted. Following that, these values will only be updated by the user via the OIP and will then be used in turn to insert some text onto the drawing. The kicker, is that I need to get input from the user before I can set the defaults and from what you're saying, these values are generated before any event happens. It seems, from what I can tell, that the values that appear in the OIP for each widget get loaded from the defaults sometime after the completion of the kObjOnInitXProperties event but before any other event happens. As a sidebar, how do you put VW into Developer Mode? I've looked through all the various preferences (both application and document) on both Windows and Mac and can't seem to find where that setting is... @Miguel Barrera That was my thought; however, unless I'm missing something, it seems that a plug-in does not maintain state between events (i.e. global variables). Initially, I would set a global variable firstRun that is tested. If it was the first run, assign defaults, if it wasn't carry-on but from what I can tell this behavior can't be accomplished without some way to store state... -g
  6. That's basically what I'm doing. It's just that I need to have slightly over 100 params (~125) and to get the next chunk to start at, say 201, I need to sit there and add and uniquely name 75 unnecessary parameters...was just hoping there was a way to get around it especially since the parameter dialog has no support for editing multiple items at a time (to set a default, change type, etc) and the keyboard navigation support is also poor. -g
  7. So, I just tested the follow: vs.SetRField(paramHandle,'Custom Object1','LS3D','789') #Where LS3D is the parameter name as defined in the plug-in defintion and it is a Y coordinate field. When I place this line as the final statement at the end of the kObjOnInitXProperties handler, nothing seems to happen. When I place this line in the Reset Event handler, it is executed; however, on subsequent calls, this overwrites any user assinged values... I've also insterted an AlrtDialog() that displays each event number before it is handled and as far as I can see, the kObjOnInitXProps is only called once (unless you go back into the plug-in definition)....And then a reset event is generated.... Thougts? -g
  8. So, vsoAddParamWidget only cares that the names match and not necessarily the ID's? -g
  9. Hey All, So, does anyone know at what point an event enabled plug in pulls in the default values from parameters? I've tried altering these values during the InitXProperties event, but they seem to get overwritten. I've also tried doing it during the Reset event; however, this would then get called on a cut and paste resulting in any user-changed values being overwritten. I figured the easy way around this was to just add a test to the Reset event to see if it was the first time that it was called; however, in doing this, I've discovered that it seems that any global variables that get assigned get wiped as soon as handling of the current event is finished...is this accurate? Or am I just missing something? Cheers, -gonda
  10. Hey All, So, I think I know the answer to this, but is it possible to arbitrarily define a plug-in's Parameter ID's? Specfically, I have a bunch of parameters that are essentially processed (added, values set, etc) in a for loop and what hoping to essentially set the first group to 101,201,301 and the second group to 102,202,302, etc so that I can loop through the values using a single for loop with just adding an offset to access the relevant parameter... ...but I'm guessing this isn't possible...or am I wrong? Cheers, -gonda
  11. Hey All, Has anyone successfully gotten linting to work with VS.Code? I've been bashing my head against this for last couple of days and just can't seem to get it play nice... I've tried pointing the linter to the Plug-Ins directory, copying vs.py to the python library directory as well as placing it in the same directory that I'm using for my plug in and none seem to work.... Has anyone successfully gotten this to work?
  12. Hey All, So, I'm in the process of developing a custom PIO that has two parts. The first part acts as a standard object in terms of XYZ as well as movement, rotation, etc. The trick is that I'm also looking to have a second part to it that always displays information in the same place regardless of the XYZ of the point object. Example: Object is located at 5',-15'. In the OIP, there is an XY field to define where the secondary info appears, say 50',50'. Right now, all of the functions I've seen in the Function Reference seem to relate to the objects origin as opposed to the drawings origin. Is there a way to reference the drawings origin from within a PIO instead of the objects origin? Cheers, -gonda
  13. Hey All, With the addition of Python as a scripting language, it would be great to see the implementation of python console. Ideally, this would be an interactive console so you could try out small snippets of code but most importantly it would give the ability to use print() statements for both debugging as well as giving user feedback without having to resort to popping up an Alert-style dialog box. Cheers, -gonda
  14. Hey All, So, now that I'm in the process of attempting to use the python that was generated by Dialog Builder, I'm finding a few other issues. I'll summarize below in addition to my already mentioned post regarding semicolons: All instances of the true/false inbuilt constants are listed in all caps (i.e. TRUE, FALSE), which generates an error since the inbuilts in python are "True" and "False". Dialog Builder is trying to pass strings directly to the GetStr function instead of an integer. Since all GetStr does, is index a number to a string I can't think of a good reason not to just pass the hard integer values in this call: dialog = vs.CreateLayout( GetStr('dialog_title'), True, GetStr('ok_button'), GetStr('cancel_button') ) Cheers, -gonda


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.

  • Create New...