Jump to content

Search the Community

Showing results for tags 'python'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Announcements
    • Announcements
    • News You Need
    • Job Board
  • Feedback
    • Wishlist - Feature and Content Requests
    • Known Issues
    • Wishes Granted / Issues Resolved
  • General
    • Troubleshooting
    • General Discussion
    • Architecture
    • Site Design
    • Entertainment
    • Vision and Previsualization
    • Braceworks
    • ConnectCAD
    • Rendering
    • Workflows
    • Buying and Selling Vectorworks Licenses
    • Hardware
  • Customization
    • Marionette
    • Vectorscript
    • Python Scripting
    • SDK
    • 3rd Party Services, Products and Events
  • Solids Modeling and 3D Printing
    • Subdivision
    • Solids Modeling
    • 3D Printing
  • Vectorworks in Action
  • Archive
    • Resource Sharing
    • Machine Design

Categories

  • Knowledgebase
    • Tech Bulletins
    • Troubleshooting
    • Workflows
    • How To
    • FAQs

Categories

  • Marionette - Objects
  • Marionette - Networks
  • Marionette - Nodes
  • Marionette - Menu Commands

Product Groups

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Occupation


Homepage


Hobbies


Location


Skype

Found 42 results

  1. I'm currently working on a couple of plug ins that need to interact with Spotlight Hanging Positions. The first thing i'm trying to do is get the total length of a hanging position. Thanks to some excellent topics and replies from @Sam Jones and @JBenghiat I've got my head around accessing the objects within the hanging position group, and the different kinds of objects I may expect to find within, and iterating through the objects to get the total length. My question is: For HP's containing Truss PIOs is it better practice to use the TrussItem parametric record or the Truss Record for getting the length? From what I can gather the TrussItem Length field is affected by the units of the active documents units, whereas Truss Record appears to always be in metric mm. I think using the Truss Record probably makes more sense as then I have a consistent set of units and don't need to worry about logic to work out the units of measurement. I just wanted to try and get some confirmation if my thinking was in fact true or if i've missed something. Secondly for HP made up of individual symbols (so no truss record) is there a way to get either the symbols total length or the even more directly the HPs total length? For bonus points are there any good resources floating around that deal with the inner mechanics of Spotlight? Pretty much everything I've managed to do with spotlight so far has had to be learnt through trail and error! Thank you in advance
  2. 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!
  3. Wondering if anyone can advise on this - I'm having some trouble with control point precision that is leading to erroneous behavior in a plugin object. I detected this issue in part through the debugger. Basically, when I drag a control point, it seems that the values I get when I access its coordinates from inside the scripting environment are truncated to only 6 decimal places. This introduces error into calculations based on that value. I have tested further by creating an object to use as a snapping location, and setting the position of this object to coordinates that require more than 6 decimal places to represent. If I increase the decimal place precision in the document unit preferences, I can see all of these decimal places in the OIP for the reference object. If I drag a control point in my plugin object to snap to this reference object, and then, by setting a breakpoint, inspect the value I get inside my script by accessing the control point (with, for example, vs.PControlPoint01Y), I see the value is still truncated, regardless of the document unit / precision settings. At only 6 decimal places, this can introduce pretty significant error. Is there some obvious thing I am missing to correct this behavior? I would expect that when I snap a control point to a location, the control point would be assigned a value as accurate as possible, or at least as accurate as the document settings indicate. Not sure if this is specific to Python scripting or not.
  4. Hi, I am currently looking into creating a script to import a folder of images and create image probs from them. I found a completely undocumented function vs.CreateImageProp(...). But as it is takes in a texture, i got lost trying to create the corresponding texture object from the images loaded. Anyone having some scripts which could help me on my path? Thanks in advance. Cheers Jonas
  5. 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!
  6. 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!
  7. I'm trying to manage the shared recourse manager at my company. In the library and on the internet I can hardly find nodes to interact with the recourse manager instead of the design layer. For example whit "objs by crit" I can only select symbols that are place in the design layer. Am i missing something or does someone has nodes i can use. What I'm planning to do: with the programme we use for managing our stock we can get an excel file with art. numbers, description, amounts and dimensions. when we make an new article/symbol and we place it in the resource manager, I want to make an script that checks the name of the symbol (which we will give manually by using the article number) When it recognises the symbol name(Art. number) it wil changes its name in art. number+description. also the extra information will be put in an record attached to the symbol. Problems(challenges) I'm facing so far: obj name and symbol name are different things. missing a node to get symbol name. attaching record is only attaching it to the symbol as object and not to the symbol itself, so when i put information in the record it doesn't change copies of this symbol. A node of some kind to get an list of symbols in the resource manager. No node of some kind to change a symbol name. I already started rewrite code's of some nodes to make them do what i want, but still learning and not much experience with python.
  8. 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?
  9. 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.
  10. So I am attempting to encrypt some plug ins objects (a mix of .vso and vsm objects) to distribute to others. I've done some searching of this wonderful forum, aswell as reading the Vectorscript Guide section on encrytion. Following the instructions in this thread. I created a XML File named the same as my PIO, My code is directly inside the object so I don't need to include any extra files so my XML file just looks like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin> <Package> </Package> </Plugin> I've selected my plug in in the plug in manager, used the Ctrl+Shift+Alt and Double Click method, confirmed twice that I want to encrypt it. All seems to be successful, it won't let me edit the script anymore. However if I go look at the .vso file in a text editor I can still see all the code. Also if I copy the file out of my plug in folder, and then copy it back in, replacing the original, (To try and test installation process for another a new user) I can then edit the scripts again. Am I missing something super obvious? I've seen other people running into similar problems in other threads, but I haven't found any solutions anywhere.
  11. Hello I'm trying to create a worksheet with a database row that looks for a certain record and then displays each field in it's own column. The issue i'm running into is actually making the row into a database row. Below is the code I am using at the moment. My understanding (which I suspect is wrong) is that I need to set the a formula for row 2 column 0. dynCharArray = '=DATABASE(INVIEWPORT & INSYMBOL & (R IN [Loom Note]))' vs.SetWSCellFormulaN(tempHandle,2,0,2,0,dynCharArray); When I run the code I get a popup box saying "Right Bracket Expected", no error messages from the script, just that popup box, and the script will have failed to turn the row into a database row. From my googling I'm struggling to find much documentation for building worksheets with Python Script/ Worksheet Formulas. (I'm sure it's out there I'm probably just not looking in the right places.) Would anyone be able to point me in the direction of some handy info on worksheet formulas, or give me a hint as to what i'm doing wrong here? Running VW 2020 Sp3.1
  12. Hello, i use a script with just the function "vs.CallToolByIndex(-210)" (for Dimension). The tool starts and i can create the dim. After the Dim is createt VW start stocking and than crashing. Is this a bug?
  13. 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
  14. Hello, I am kind of new on Python but not on Vectorworks. I have a custom symbol that contains 2 text labels: one contains a number like "2,43", the other is always the same text not attached to the database. I need to get read that "2,43" and later do the contrary: be able to write into the field in the symbol another number. some ideas?
  15. Greetings Pythonistas, Getting "SyntaxError EOL while scanning literal" script error, when there is an apostrophe in one of the parameter fields of my custom plugin object. I am trying to figure out how to catch/handle this exception before it gets processed. Any thoughts @Dieter @ DWorks, @JBenghiat@Hippocode.. trying to think of others.. @Miguel Barrera@Pat Stanford@Matt Panzer..
  16. Heyo, I tryed to use parameter and strings wich can be added in the Plugin Manager. But i dont get how to use them in the Python Scripts... The Vectorworks Helpsheet dindt really help to make this clear. Can someone take my dumbness away and tell my how this System works?😅
  17. Here's what I'm trying to do: User selects an object User then selects the PIO tool and inserts the PIO PIO uses info from the selected object as a parameter value. Currently: I get the handle to the user selected object using LSActLayer or FSActLayer. Use GetRField to extract the information from the object. Run GetCustomObjectInfo to get the PIO handle Write the information to the PIO using SetRField The problem I'm having is that it appears that a PIO resets(vsoGetEventInfo #3) itself 3 times before the creation is finished. On the first reset event the handle still points at the user selected object, on the second reset event the handle is empty, on the third reset the handle points to the new PIO. Short of writing the information to a file how do I get the information from a user selected object into a PIO on creation?
  18. I just spent three hours trying to track down problems with my Anaconda python installation when I remembered to my chagrin that I had recently updated my Vectorworks 2018. I then remembered that for some reason Vectorworks likes to put the Qt DLL libraries in the Windows\System32 directory which immediately breaks the Anaconda installation. Don't Do This! Vectorworks works perfectly well when the Qt DLLs are placed in its own home directory. I really don't want to forget about this the next time I update Vectorworks and go through the process of reinstalling Anaconda because I mistakenly believe I broke a python library.
  19. Hi, Some years ago I wrote a few tools in Vectorscript based on a number stamp. The idea is simple enough: enter a starting number in a dialog, start clicking, the number increments and is "printed" in the drawing on each mouse click. In the actual implementation there is other stuff going on too, but it's just this part I need help with at the moment. The Vectorscript tools work fine, but now I would like to re-write them in Python, but I can't get it working at all! This is because I am probably too stupid to understand what I need to do, but also it is because of the way GetPt() seems to works in Python. Also I don't get how to use KeyDown() in Python. I am open to any suggestion on how to do this in python in any way it works: Enter a starting number in a dialog Start clicking to add numbers (as text) that increment with each mouse click. It seems like this should be simple enough, but I have been trying to get it to work for a while and i can't! Any help would be much appreciated. Here, below, is a simplified version of my Vectorscript that works fine, and below that one example of how I have tried (and failed miserably) to translate it to Python: { V4 Simple Number Stamp Tool By: Benedick Miller Date: 2014-10-06 } Procedure SimpleNumberStamp; VAR n,i,keyhit:INTEGER; pt:POINT; t:STRING; BEGIN n:=IntDialog('Enter the starting number','1'); IF NOT DidCancel THEN keyhit:=27; i:=1; DSelectAll; while not keydown(keyhit) do begin t:=num2Str(0,n); getpt(pt.x,pt.y); TextOrigin(pt.x,pt.y); CreateText(t); n:=n+i; redrawall; end; END; Run(SimpleNumberStamp); And the Python translation: # Print Incremental Numbers on each mouse click until [Esc] # NOT WORKING!!! import vs def label(pt): vs.TextOrigin(pt[0],pt[1]) vs.CreateText(str(n)) vs.ReDraw() def kdwn(): k=vs.KeyDown() return k[1] keyhit = 27 i = 1 n = 1 vs.DSelectAll() n = vs.IntDialog('Enter the starting number', n ) if not vs.DidCancel(): while not kdwn() == keyhit: vs.GetPt(label) n = n + i
  20. Hello people, I just edit because I found this way. import vs import os Vendor = 'ACME' Price = 123.45 Tax = 1.07 fileName = 'Classes.txt' def Example(): vs.GetFile(fileName) if not vs.DidCancel(): vs.Rewrite(Vendor, 0) #vs.WriteBin(Vendor) #vs.WriteMac(Vendor) #vs.WriteLnMAC(Vendor) #vs.Write(Vendor) vs.Close(fileName) Example() But, the next attributes get this message: "AttributeError: module 'vs' has no attribute 'WriteBin'. " -vs.Write -vs.WriteLnMac -vs.WriteBin -vs.WriteMac With write I don't get error, but also no result. -vs.Rewrite
  21. Hello, I have been working on a few Python Scripts that use third party libraries - for example BeautifulSoup4. I intend to Encryption this script into a vsm plugin so that the external libraries are bound to it and can be used on other installations of Vectorworks. I realised that the Encryption/Obfuscation method through Vectorworks is not able to bind the external packages into the vsm file: I've included the path to these libraries in the Script Options and I am using the steps indicated by Vlado in this post for the related xml file. <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin> <Package> <File>code/__init__.py</File> <File>bS4/</File> <File>bS4/__init__.py</File> <File>bS4/.py</File> <File>bS4/diagnose.py</File> <File>bS4/element.py</File> <File>bS4/testing.py</File> <File>bS4/builder/__init__.py</File> <File>bS4/builder/_html5lib.py</File> <File>bS4/builder/_htmlparser.py</File> <File>bS4/builder/_lxml.py</File> </Package> </Plugin> Can any one advise on how to resolve this? Thank you in advance. Giovanni
  22. Hello, I have been working on a few Python Scripts that use third party libraries - for example BeautifulSoup4. I intend to Encryption this script into a vsm plugin so that the external libraries are bound to it and can be used on other installations of Vectorworks. I realised that the Encryption/Obfuscation method through Vectorworks is not able to bind the external packages into the vsm file: I've included the path to these libraries in the Script Options and I am using the steps indicated by Vlado in this post for the related xml file. <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- This file defines how the corresponding script plug-in should be packaged--><Plugin> <Package> <File>code/__init__.py</File> <File>bS4/</File> <File>bS4/__init__.py</File> <File>bS4/.py</File> <File>bS4/diagnose.py</File> <File>bS4/element.py</File> <File>bS4/testing.py</File> <File>bS4/builder/__init__.py</File> <File>bS4/builder/_html5lib.py</File> <File>bS4/builder/_htmlparser.py</File> <File>bS4/builder/_lxml.py</File> </Package> </Plugin> Can any one advise on how to resolve this? Thank you in advance. Giovanni
  23. There are many ways to customize Vectorworks to better fit your needs. You can script in VectorScript or in PythonScript. You can create a Marionette network. You can create a custom worksheet. What you have not been able to do until now is find an in-person place to interact with others also interested in customizing VW. Michael Klaers and Pat Stanford (all around Good Dudes™ and frequent posters on the forum) would like to change that. But we need to judge if there is sufficient interest to make it worth our time to do the organizing. We have posted a short survey. 10 questions. You can answer them all in less than 2 minutes. Give us 10 minutes and you can have massive input into the event. We are truly interested in your responses, regardless of if you like the idea or not, we would like to get your feedback so we can see a broad cross section of users. The survey is posted at https://www.supersimplesurvey.com/survey/20404/conference-interest No personal information is required. We won't spam you. We just have this idea and want to see if others are with us. Thanks in advance. We hope the interest exists and we will see you at the first annual Customization Conference.
  24. After I installed Vectorworks 2018, my Anaconda python installation could no longer use Qt, so python apps like spyder and matplotlib didn't work. I found out that, for some odd reason, Vectorworks 2018 puts the Qt dll files (QtCore.dll, etc...) in the Windows/System32 directory, which overrides the ability for python to use the PATH environment variable to find and use its own installed Qt DLLs. I moved the Qt DLLs from the Windows/System32 director into the Vectorworks2018 folder, and that seemed to fix the problem. Both Vectorworks and my Anaconda python distribution work properly now. I had to do this again after the most recent Vectorworks Service pack update. I would strongly urge Vectorworks to not use the Windows/System32 directory for DLLs that can interfere with the operation of other installed programs. Just thought I would post this here in case anyone else runs into this issue.
  25. As promised, I wanted to highlight some new things you'll see for Marionette in Vectorworks 2017! I've made a little video with snippets of the improved features, and although I haven't gotten to it yet, I'll go into greater depth of the more complicated features and how you could incorporate them into your workflow! (I know, I'm a slacker, but I still haven't gotten over hearing my own voice... so recording more videos has been slightly traumatic.) If you have any questions, big or small, I'm available almost all of the time (while I'm not eating or sleeping) to obsess over Marionette with you!

 

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