Jump to content

sully8391

Member
  • Content Count

    33
  • Joined

  • Last visited

Everything posted by sully8391

  1. Thanks for the clarification! I'll have to take a look again.
  2. Thanks for this! I finally got it working. GetNameFromResourceList, and variations on that, will return empty strings/handles if called before ImportResourceToCurrentFile. In my case that's no big deal, because I intend to import all of the symbols anyway. It's also worth noting that the resource list starts its indices at 1.
  3. Hi all, I have some plugin objects that I would like to use predefined symbols instead of drawing their geometry for each instance, but I'm having a lot of trouble figuring out how to import a symbol from a user library. It looks like the functions under "Document List Handling" might hold the key, but I can't make any sense out of them. Is what I'm trying to do possible? What would a basic script for this look like? Thanks!
  4. The dimensions don't even turn red to indicate that the tool is hovering over them, it's like the tool doesn't even see them. They're definitely snapped to the same point, and it works just as expected with the Line object. I've also tried restarting VW. For now I'm just drawing a regular line over the dimension and using that, but it's super weird.
  5. Earlier today I was able to draw an angular dimension between two linear dimensions, now for no apparent reason I cannot select the linear dimensions when I have the angular dimension tool selected. This worked: But here VW will not allow me to draw an angle between the two diagonal dimensions: Any ideas? Thanks all!
  6. Constraints are exactly what I need! Thank you. Do you know if there's any more documentation of the constants in the SDK? At least the horizontal and vertical distance constraints are swapped on the wiki. These are useful, but I'm having trouble with the other constraints, and I don't even know if I'm using the correct constants.
  7. I see. Do you know if maybe there are any extended properties I need to enable to be able to add certain associations? For example, it seems that associations 38 and 39 are responsible for keeping objects attached to truss and lighting pipes, but when I try adding this association to my plugin objects and then print their associations, there are still zero associations. This is essentially the behavior I'm looking for, one object recalculating its position based on another object. Or is there some function out there that does this, that I just haven't found yet? Both objects are event enabled and the delete-on-delete association is working fine. Thank you!
  8. Hi all, The wiki only lists two constants for vs.AddAssociation, 4 and 5. I figure there must be more, but I've scoured the SDK and found nothing. Anybody know if there are other associations, what they are or at least which SDK file I should be looking in? Thanks!
  9. I had given a Database Worksheet some thought, but I wasn't able to find any methods that allow me to create a database with Python, and that's a requirement. I also don't think storing these as parameters will work, because the number of components being formatted is configured by a user, and a simple PIO could easily see 256 parameters. If it's possible to create a Database with Python, this could work for the other PIO's I'm working on, because the worksheets are just schedules and can link to actual parameters in the OIP. As for a hidden record, are you referring to a record that's automatically created like the one for parameters, or one that I generate? There are a number of times I've thought about using a record for data storage, but there are just so many things I want hidden from users. There are also general preferences I'd like to set for the plugin-package, but I don't see how that's possible without instantiating persistent objects. I'm seeing some success using a dialog to act as an interface between the user and the worksheet, in which case I can execute scripts that update either the PIO or the worksheet as part of the dialog, but what I really (really, really, really) want is to treat the plug-in object like, well, and object, in the OOP sense. Then I could just create a dictionary and use a dialog to edit it; piece of cake. Actually, I can't count the number of times I've wished to interact with a PIO like an OOP object. Is this something that's possible in the SDK? I have to imagine that each instances of a plugin object is in fact an OOP object, if I could extend that object then all my Vectordreams would come true. Thanks for your knowledge!
  10. I have two worksheet questions. 1.) I'd like to link rows of a worksheet to instances of a PIO to store some parameters and format settings. Right now I'm creating a UUID, storing that in a hidden parameter and in the last column of the worksheet, and then I match the UUIDs to push/pull data. This is not only a bit ugly, but a user can easily change the cell, breaking the link. On the other hand, if I store the initial row number in a hidden parameter, the user could rearrange the rows and break the link that way. Is there an elegant way to link rows with Python/Vectorscript? Or maybe some methods I've overlooked that might help? 2.) The PIOs are event-enabled, so when a parameter is updated, it automatically updates the worksheet. I'd like this to work the other way around. In the SDK I found this property: kObjXPropGetWorksheetEvents = 57. To me that looks like an event-enabled PIO is aware of changes in worksheets, but I haven't been able to find any other information on what event IDs to use, or how to point a PIO at a specific worksheet. Is is possible for edits in a worksheet to trigger a parametric recalc in a specific PIO? Thanks, All!
  11. I'd like to remain in developer mode for as long as I'm editing external scripts. As I understand it, this ensures that the script is compiled every time it's run. Thanks for showing me the path to the ErrorOut text file, that should prove to be useful either way.
  12. Hi all, Is there a way to suppress error messages without turning off developer mode? I'm using VS functions within try/except statements, and I'm still getting error messages; I don't need to see that there's an error if I've told it what to do when there is one, and coding to avoid the error altogether is more cumbersome.
  13. thanks @Nik and @JBenghiat I found the reload() function but hadn't found the one for caching. reload() saved me lots of headache, and everything is running quite smoothly now.
  14. Update: Ignore people who code at 4:00 am. I found the real problem, and it actually was, in one execution of the function, attempting to convert a None to an integer. *infinite face-palm* Apparently a Mac doesn't care to tell you and just considers it a 0. Fixed it with an if-then.
  15. @JBenghiat The indents are from pasting. I eventually just had to make a new plugin and copy all the code and have ditched the external editor until I get more comfortable with Python in Vectorworks. I'm still getting strange errors, but this might have something to do with my windows machine. For example, I have one function that relies on converting a string to an integer. On my Windows machine I get "Error trying to convert string to number" (I have to use vs.Str2Num() first, because Vectorworks doesn't seem to like int()), but then it executes all the lines of code that require that conversion to happen. When I try this on my Mac, there are no errors. If I didn't have any ancient computer monitor and could use it with my Mac, I'd just ignore it for now, but I can't code and do CAD on a 13" screen.
  16. I don't know VS, but it looks similar to a Python import function. Using that method, at least as I understand it, things are sort of working. I've set the environment path in "script options" to a folder containing my script, which includes a main() function. In the Vectorworks script editor all I have is this: import Blocks Blocks.__main() But there's a bit of code in the script that's broken now. Below is a simplification of what's going on. This works fine when in the Vectorworks editor but breaks in Sublime. Any ideas? def __main(): valid, objN, objH, recH, nilx = vs.GetCustomObjectInfo() record = vs.GetName(recH) vs.Message(str(objH)) #this prints a valid Handle name = vs.GetName(objH) #but this tells me the handle variable is NIL
  17. As I've read, it's possible to use an external text editor instead of the built-in one. I'd like to be able to keep a .py file open, save it, and have it automatically update in Vectorworks, and I'd think there would be a way to select a file to be referenced, but I can't figure out how to do this; I also haven't found anything useful on the developer page. When I navigate to the plugins manager there are .vso and .vst files with the names of plugins I've created, but if I try to open them in Sublime it's just a string of integers. How can I integrate a text editor into my workflow?
  18. Restarting Vectorworks solved the problem, seems like even though I changed the language to Python, Vectorworks was still interpreting it as VectorScript.
  19. @MullinRJ Weird, I just created a new tool, and it works fine. The first one keeps giving me this error no matter what. I did have it set to Vector Script initially, but fixed that after the first time I had the error, so I wonder if that has anything to do with it. No hidden characters. I'll have to see if a restart corrects it.
  20. I have some simple scripts working already, so now I'd like to make those scripts into plugin objects or tools; I've been using Python for 2 or 3 years mostly within TouchDesigner and have written some pretty robust code, so I'm very comfortable with that side of things. I think I could move one step forward if I just understood what this error is trying to tell me. Python is the selected language.
  21. I'm trying to explore scripted Python plugins, but I'm having trouble finding any basic information on how scripts function within a plugin and interact with specified parameters. For example, I've created a tool plugin and put in what I thought was the most basic script: vs.Message('Test Tool') When I click on the tool I get an error message: Identifier Not Declared. What does this mean? I tried declaring a function and then running the function, but I get the same error, always on the first line; even /import vs/ will give me this error. Just looking for a place to begin experimenting.
  22. I have a drawing label that seems to be in limbo. I know it somehow ended up in a class that it's not supposed to be in, but I've turned on every single class and still cannot see it. I've also tried making it appear using custom selection to no avail. Is there another way to grab this object?
  23. I thought it might be a visibility issue, but it seems to be an issue with specific tools, the speaker tool and riser tool in particular. Looks like I just have to redraw the geometry for now.
  24. Hi all, I have a section viewport on a design layer that I'm trying to convert to polygons. I've done this for another section, and it was fine, but now for all the sections I try to make anything that is beyond the cut plane is deleted. "Display Extents beyond cut plane" is checked and render mode is hidden line. Any ideas? Thanks!
  25. Hi all, I've been having issues with the speaker tool and the array tool. With the speaker tool every now and again every speaker will disappear. I have confirmed multiple times that they are not in a hidden class or layer, and we're talking 70 speakers in multiple classes on multiple layers, so accidentally deleting all of them at once is highly unlikely. I've tried re-importing the symbol and doing a custom selection. For now when it happens I just open a previous file and copy and paste the speakers in. Still wastes a lot of time getting all the speakers back to their correct position, but this only happens with point sources. The array tool is special in its own way. I have my arrays on Braceworks hang positions, and when I change the trim height of the system, the bumpers will follow, but sometimes the speakers follow, sometimes they don't, sometimes they end up 20' higher than the bumper, and sometimes two arrays are fine, but then three others are completely out of whack, and I have to reconfigure or repopulate the arrays. Am I doing something wrong, or can I be sure these are bugs? Vectorworks 2020 SP3.1 (Build 537701) Designer/Renderworks Educational Windows 10 64bit

 

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...