-
Posts
765 -
Joined
-
Last visited
Reputation
948 SpectacularPersonal Information
-
Location
United States
Recent Profile Visitors
9,028 profile views
-
Text within symbol to report symbol name
Jesse Cogswell replied to Ioannis.K's question in Troubleshooting
I wrote up a plug-in object that will do this. I call it a "Parent Reporter." It will determine the name of its parent and will create a text object reporting it. If you drop it on a design or sheet layer, the text will name the layer. If you drop it in a viewport annotation, it will report the name of the viewport. And, important to this topic, if you drop it in a symbol, it will report the name of the symbol. The font, style, and size of the text can be changed by selecting the object and using the Text top menu. There is also a checkbox in the Object Info Palette that will allow you to wrap text and set a text width. Only things to note are that if you use one of these at the time of the symbol creation (selecting geometry and Parent Reporter and using Create Symbol), you will need to edit the symbol and reset the Reporter object by either moving it, or by cycling the Wrap Text OIP setting before it will read the symbol name properly. Same goes for renaming the parent (layer, viewport, symbol), you will need to reset the object. You can download the attached Parent Reporter.vso file to your Vectorworks user folder in the plug-ins directory and add it to your workspace. It can be found in the JNC category under Tools and will work with any version of Vectorworks 2019 or newer If you need any assistance, please feel free to ask. Parent Reporter.vso -
@DCB I've been writing readme documents for the tools when I get time. It's not an awful process, but can be a time consuming one, so I have them for only a handful of the tools. In the manager, if you click on a tool that currently has one completed, the View Readme button will be enabled and clicking on it will open the readme in your default browser. If there are any you have questions about, 90% of them were written and posted on this forum, so searching the name of the tools may turn up the original posts (search these in Google my including the name of the tool and "Vectorworks forums" in the search, don't bother trying to search directly in the forum search bar, you likely won't find what you are looking for). Otherwise, feel free to reach out in a DM if you have any questions and I will do my best to get back to you when I am able.
-
The other thing to check is that you're not migrating plugins to an older version of Vectorworks. Once you edit a script, that script is locked to that version or newer. It's why I still have VW2019 installed on my laptop and do all my development in it.
-
Sorry for the delay, I've been on vacation the last couple of days and away from my computer. I wrote up a little script that might do what you are asking for. Running the attached command will open a dialog box showing all named objects within the active drawing (including "hidden" special records and objects used under the hood). You can select which ones you would like in a report (with a handy option to quickly highlight all matching object types) and which columns to include. When you press OK, you will be prompted to enter in a unique name for a worksheet. Once entered, a Worksheet will be created with all checked items and columns. You can also enter the name of an existing worksheet if you wish to overwrite it. Columns are sorted by Object Type by default, but you can sort by whatever you wish by clicking on a column header. Unfortunately, there's not a way to have a double sort (first by Object Type, then by Object Name). There is a hard maximum row count in worksheets of 32767, so you will be restricted to 32766 object names before you reach data loss (this really shouldn't be an issue. If you have 32767 unique names in a single drawing, you likely have bigger issues). This worksheet can then be exported to Excel for faster "Find" functions. If you aren't familiar with installing and using plug-ins, there are some instructions on this README page. For (slightly) easier installation, you could consider using my Free Manager tool that will handle the installation of the plug-in and can be used to keep everything up to date (and has lots of other free plug-ins): The Object Type names are coded into plug-in strings for easy localization, but not all object types are included in the appendix, so I've invariably missed some. If you run the command and the Object Type column is empty, let me know what the resource type is and I will get it updated. If you would like to know more about the underlying code and how it works, please let me know and I will be happy to share it. Create Named Object Report.vsm
-
Security, Encryption and Distribution
Jesse Cogswell replied to AlHanson's topic in Python Scripting
Understood. In that case, the Python has no access to the parameters directly since they are actually part of the VS code. You could keep the structure you have by instead passing the parameter values into the string repository on the VS side where they could retain their original type, then use Rpstr_GetValue<type> on the Python side to retrieve it. Just remember to name the ID string something unique so that you don't overwrite a setting accidentally, I usually do something like '<plugin name>.<value>'. In this case, you would also probably want to remove the values after the shuttling has been finished to avoid having parameters cross-contaminate between objects. The string repository is indeed application wide and persistent, so it's great for storing recurring dialog box values or settings. It will also be required for passing variables between scripts as you are trying to do. -
Chair object missing parts in 3D view
Jesse Cogswell replied to Darin K's question in Troubleshooting
Are all classes currently visible? I do believe @Jeff Prince is entirely correct, but the missing pieces won't be selectable until the class is visible. When in doubt, I usually do the Alt+ click on the Visible column in my Navigation window to turn on all classes, then select the formerly missing components and change them to a more desirable class, then click on the "back arrow" to restore my previous class visibility. EDIT: Hmm, I located the chair you are using (Furn Girsberger Office Chair Diva, I believe) and imported it. It looks like the legs are in a nested Group in the symbol in the Dimension class. -
The windows are using the texture that is tied to the Glazing-Clear class, called Glass Clear RT found within the zNested Textures resource folder. It has a 15% blurriness applied to both the Glass and Transparency shaders, and a fairly low transmission (70%). By default, anytime you add a window or door containing glass, a Glazing-Clear class will likely be created and the default Glass Clear RT texture will be imported into your drawing. Somehow, this texture got changed to add blurriness and that's what is screwing up your rendering. Blurriness doesn't show up in Shaded render modes (at least I don't think it does, but haven't used 2025 enough to know for sure if this is still the case), so you wouldn't catch it until you did a Redshift or Renderworks rendering. So, you can edit the texture or change the associated texture tied to the Glazing-Clear class. Some other things that you should know in particular when using Redshift (which may have been fixed in VW2025): Redshift calculates refraction completely differently than Renderworks. Generally, you'll want to set refraction to 1 to avoid your windows from looking like they are full of water. Glass reflection shaders don't work properly with Redshift. I've made it a habit to use a Mirror shader instead. Before saving a file to upload on the forums, make sure the active rendering mode is either Shaded or Wireframe and not something with a heavy processing load like Redshift or Renderworks, it takes a much longer time to get the file open and ready for editing.
-
Can you copy the wall and windows into a new document and post it on the Forums? There might be something weird in the texture we're not able to see. Also add any of your Render Styles that you are using.
-
Security, Encryption and Distribution
Jesse Cogswell replied to AlHanson's topic in Python Scripting
Can you explain a bit more about your current structure? Is the Python script a plug-in object and the VS a tool that starts the event loop of the PIO? If so, I think this approach is a bit backward. You could instead have the license check be a menu command that the PIO calls as a vs.DoMenuTextByName function instead. You could have the VS verification script to store a value using Rpstr_SetValueBool that the PIO can read in. Once read and checked, you could use vs.Rpstr_RemoveValue to then clear the check. That way you could even use the same verification script for multiple plug-ins. -
Security, Encryption and Distribution
Jesse Cogswell replied to AlHanson's topic in Python Scripting
Hmm, I don't know why the 'variable = vs.PparameterName' would work in a directly executed script but not an imported one. I suspect that running the Python import command on a script with embedded parameters won't work because the parameter values wouldn't transfer as part of a standard Python import, as that's outside of the regular Python scope. You might try using vs.GetRField instead, passing in something like vs.GetRField(vs.GetObject("toolScript"),"toolScript","<parameterName>") instead. But this might also break since I don't know if the record has to be currently present in the active drawing for GetRField to work. Do you need to use parameter values? -
Security, Encryption and Distribution
Jesse Cogswell replied to AlHanson's topic in Python Scripting
Everything looks correct in the code that you've posted. And it appears that it is correctly finding the toolScript file because otherwise it would throw an error about not having toolScript module installed. Try opening up a new document script and setting the language to Python and doing the two line Python command. Does it work in that case? Where is the toolScript file saved? There is a chance that the rules for importing files are slightly different when running Python natively vs. embedding it in Vectorscript, but I've never tried to do something like that. But like I said, if VW couldn't find the file, it should throw an error even in a Vectorscript. Make sure that the code is working correctly natively in Python, you might have an error in the executeEventControl() that's not returning properly. What does that function do? I wonder if its execution is technically falling outside the Python context that you've set up so that it's not working properly, but then again that would make external libraries effectively useless, so I doubt that's the case. -
Security, Encryption and Distribution
Jesse Cogswell replied to AlHanson's topic in Python Scripting
If you are worried about security, you could consider scripting in Vectorscript, as the encryption functions actually do fully encrypt the scripts, only parameter names and plug-in strings are not encrypted: This will, of course, limit you a little bit as Vectorscript is much more limiting than Python in terms of handling data on the back-end, but in terms of interacting with Vectorworks, you're pretty much limited to the Vectorscript functions anyway. When you do need something more advanced, you can use PythonBeginContext, PythonEndContext, and PythonExecute functions to write embedded Python into the Vectorscript, which would then also be encrypted. It gets a little tricky passing variables back and forth, as there is not really a way to pass arrays or lists back and forth, and if you are encrypting the script you can't use vs.GetVSVar or vs.SetVSVar, but instead have to use the string repository functions (vs.Rpstr_SetVarStr, etc) to shuttle data back and forth. Tedious, but absolutely doable. It's one of the reasons that I haven't jumped ship entirely from Vectorscript to Python. The way Python handles data and the large number of libraries for more advanced functions are very enticing, but the fact that the Vectorworks implementation negates a lot of the advantages of object-oriented programming (still need to use handles for just about everything) and no real way to protect your code are deal breakers for me. -
Set LX (electric) drawings and 3d geometry
Jesse Cogswell replied to NickSolyom's topic in Entertainment
I've done LED tape as lighting devices with hybrid symbols. I model the LED tape in 3D using Extrude Along Path, then draw a 2D representation in plan view (I like to use a gradient to show what colors are available in the tape, then have the specifics in the paperwork). You could then use a data tag with a triangle to point it out as a practical, or you could embed a triangle as part of the 2D component of the symbol, but it might be tricky getting a label legend to work properly without making a label legend per piece of tape. You could assign a triangle container symbol (with the RGBTW included) to the Unit Number and so that you can easily move it around to best suit the drawing, but a datatag is probably the best way to handle it. In case you are new to turning symbols into Lighting Device objects, the process would look something like this and could be done "in place" on the scenery: Create 3D geometry using the 3D geometry of the scenery. In Top/Plan view, create the 2D geometry that will best represent the piece of tape. Select both the 3D geometry and the 2D geometry. Run Modify - Create Symbol. This will create a hybrid symbol (no need to use an auto-hybrid here, I do my best to avoid them as they are resource hogs and I find them to be more tedious to edit than hybrid symbols). In the Resource Manager, find the newly created hybrid symbol and right click it and select Attach Record. Choose Light Info Record by placing a checkmark next to it. It's best to set some of the parameters at the same time by pressing the Edit Values button. This will let you specify the Inst Type and Device Type ahead of time. Once that's all done, select the symbol in place and run Spotlight - Object Conversion - Convert to Lighting Device. This will change it into a Lighting Device object, pulling the data from the Light Info Record that you specified earlier. If the geometry needs to change later in the process, you would just need to edit the symbol geometry (a little harder to do in place now that it's a Lighting Device, but there are ways to make it work), and the Lighting Device should automatically update. -
You get the index by using Name2Index and passing in the name of the line style. If I remember correctly, you have to pass in a negative value using SetLSN for anything outside of the regular fill patterns. I'm not sure if there's a pattern to how Vectorworks assigns index numbers to objects, I'm pretty sure it just increments up as resources are created, not sure if there are designated blocks for different resources. Never tried scripting creating complex line styles.
-
JNC Tools Free Manager
Jesse Cogswell replied to Jesse Cogswell's topic in 3rd Party Services, Products and Events
@Sebastiaan I'm not seeing your post now, so I trust you figured it out, but that error comes from not having the manager in your workspace. The embedded script does a check to see if you have the plug-in installed, and if you do, it tries to run a DoMenuTextByName call to run it. If it's not in your workspace, it can't do that. I am planning on giving the user an option to automate adding the tools to your workspace as they are installed, but the scripts to edit the workspace are poorly documented, and I haven't quite cracked how to do it without crashing Vectorworks.