Jump to content

Jesse Cogswell

Member
  • Posts

    206
  • Joined

  • Last visited

Reputation

136 Spectacular

4 Followers

Personal Information

  • Location
    United States

Recent Profile Visitors

846 profile views
  1. After further testing, CreateDuplicateObject DOES INDEED work for duplicating symbol definitions, just not in Vectorworks 2019 where I was developing the original script. I made a quick test file with the code Pat posted above, and it would not work in 2019 at all. Opened the exact same file in 2021 and it worked just fine in duplicating symbol definitions. I'm going to keep the original code as is to maintain backwards compatibility.
  2. Do you have something selected? The tool will not work if nothing is selected, and will be greyed out in the menu. If you do have something selected when trying to run the tool, then we have bigger problems. I don't think "Get Viewport Location" or "Set Viewport Location" are mine, but they likely have a similar issue.
  3. @Boh Retaining the original record defaults was the idea, but I can see how overwriting the defaults could also be useful. I've added some code so that if it detects that records are being transferred, it will poll whether you want to overwrite the defaults using the current data. It will ask you for each attached record, so if you don't want to overwrite all of the records, you don't have to. Updated plug-in attached. Make Symbol Unique.zip
  4. @drelARCH & @Boh thanks to some ideas from @Pat Stanford, I was able to overhaul the way the plug-in works and come up with a way to keep attached records and retain the linked text. It should work with RM tags, but I haven't really tested them, but any record formats and data should come through. I did a quick test with page-based symbols, and things appear to be working fine, but let me know if you still see anything weird. Updated file attached. To install it, follow the same instructions above through step 7 (assuming you haven't moved the tool around in your user folder. If you have, delete the .vsm file for it before installing), no need to edit your workspace again. Make Symbol Unique.zip
  5. Okay, so I started writing up a whole thing how none of the duplicate commands in the function reference apply to symbol definitions, as those were the things I tried first. But in the process of writing that up, I got an idea to "crawl' through the selected symbol and use CreateDuplicateObject with each object in the symbol. After some tricky coding to get those duplicated objects into the new symbol definition in the proper planes, I was able to make that work and without having to navigate around the quirks with the SymbolToGroup command and the problems it causes with high level objects. The added benefit is that text objects linked to a record format now retain that link, meaning I was able to transfer records over as well, which was a huge downside to the original tool. Big props to @Pat Stanford for making me get off my butt and work for it. Updated tool attached. Same installation as before. EDIT: Due to a request from another user, I've added the option to either retain the original symbol's records in the new symbol, or to overwrite the defaults with the symbol's current values. It will prompt for each attached record, so you don't have to overwrite all of the record formats unless you want to. Make Symbol Unique.zip
  6. @MarcelP102 Took another crack at the script, and I think I got it to work. Let me know if you see anything else that isn't working as expected. You should be able to do the same process using the Install button in the Plug-in Manager to install it as long as you haven't moved it around in your user folder (if so, delete the file from the user folder before installing). No need to worry about editing your workspace again. Make Symbol Unique.zip
  7. @MarcelP102 The way the script works is that creates a new symbol with the unique name, drops the original symbol into the symbol definition, converts the symbol to a group, then ungroups the group to leave in the geometry. For hybrid symbols, it does this twice, once for 2d geometry and once for 3d geometry. My guess is that the error is a result of the walls essentially being dropped in twice, as they are hybrid objects themselves. I'll look into this a bit more tomorrow, I might be able to fix it. Until then, avoid using the tool on symbols containing hybrid plug-in objects (other hybrid symbols should be okay).
  8. I had a little time off this afternoon, so I made this tool. It will grab all of the data from the latest selected symbol, and essentially duplicate it in the same Resource Manager folder and with the same insertion options. It will then delete the source selected symbol and insert the new one in its place, applying the class and scaling data from the original. The only thing that you will lose is any attached record data. It will prompt you to enter a new name for the symbol, and will autofill with the syntax <Original Symbol Name>'-#', with the number automatically incrementing to the next available number. It's even smart enough to parse the source symbol's name to determine if the last token is a number, then to start incrementing based on that. For example, if you run the command on a symbol named "Symbol-A-1", the script will suggest "Symbol-A-2" as the new name. It will also work on purely 2D symbols, purely 3D symbols, or hybrid symbols. To install it, follow the steps below: Download attached .zip file to a convenient location Start Vectorworks, if it isn't open already Go to Tools - Plug-ins - Plug-in Manager Click on the Third-party Plug-ins tab Click on the Install button Point Vectorworks to the .zip file you downloaded earlier Restart Vectorworks Go to Tools - Workspaces - Edit Current Workspace Click on the Menus tab In the box on the left, scroll down and expand the category named JNC In the box on the right, find a home for the command to live, such as Modify or Tools Click and drag the command Make Symbol Unique from the box on the left to a destination on the right. Click OK Likewise, you can put the command into the menu Object Context so that it is available with right-clicking an object, or assign a shortcut key to it. The script is also smart enough to detect whether the selected object is a symbol, and will tell you if the most recent selected object is not a symbol. MAJOR NOTE: the symbol must be on the currently active layer, as it uses the FSObject command to find the symbol. If you have your Layer Options set to Show/Snap/Modify and select a symbol on a different layer, the tool will yell at you for not selecting a symbol. Let me know if you have any questions or if the tool behaves unexpectedly. Make Symbol Unique.zip
  9. @MarcelP102 I had a little time off this afternoon, so I made you this tool. It will grab all of the data from the latest selected symbol, and essentially duplicate it in the same Resource Manager folder and with the same insertion options. It will then delete the source selected symbol and insert the new one in its place, applying the class and scaling data from the original. The only thing that you will lose is any attached record data. It will prompt you to enter a new name for the symbol, and will autofill with the syntax <Original Symbol Name>'-#', with the number automatically incrementing to the next available number. It's even smart enough to parse the source symbol's name to determine if the last token is a number, then to start incrementing based on that. For example, if you run the command on a symbol named "Symbol-A-1", the script will suggest "Symbol-A-2" as the new name. It will also work on purely 2D symbols, purely 3D symbols, or hybrid symbols. To install it, follow the steps below: Download attached .zip file to a convenient location Start Vectorworks, if it isn't open already Go to Tools - Plug-ins - Plug-in Manager Click on the Third-party Plug-ins tab Click on the Install button Point Vectorworks to the .zip file you downloaded earlier Restart Vectorworks Go to Tools - Workspaces - Edit Current Workspace Click on the Menus tab In the box on the left, scroll down and expand the category named JNC In the box on the right, find a home for the command to live, such as Modify or Tools Click and drag the command Make Symbol Unique from the box on the left to a destination on the right. Click OK Likewise, you can put the command into the menu Object Context so that it is available with right-clicking an object, or assign a shortcut key to it. The script is also smart enough to detect whether the selected object is a symbol, and will tell you if the most recent selected object is not a symbol. MAJOR NOTE: the symbol must be on the currently active layer, as it uses the FSObject command to find the symbol. If you have your Layer Options set to Show/Snap/Modify and select a symbol on a different layer, the tool will yell at you for not selecting a symbol. Let me know if you have any questions or if the tool behaves unexpectedly. Make Symbol Unique.zip
  10. @Jayme McColgan The script you are looking for is ApplyCustomTexPart. Texturing through Vectorscript/Python is a bit obtuse, but can be pretty powerful as you can add custom texture parts (so you can texture your 3D poly inside of the PIO separately from the rest of the object, and even give it a unique name such as "video screen"). Basically, you define the parts, then use ApplyCustomTextPart to apply the texture of that part using vs.ApplyCustomTexPart(<handle to PIO>,<handle to destination object>,<part ID #>), then select the Part in the Render tab of the OIP. I have not been able to successfully get the texture to a place where the Attribute Mapping Tool will allow you to click and drag the texture around, but the standard Scale, Offset H, Offset V, and Rotation fields of the Render tab of the OIP work as expected. I've attached a Vectorscript example that I used to teach myself texturing through script (I use Vectorscript rather than Python, but you should be able to follow along with what the code is doing). Let me know if you have any trouble installing the plug-in or if you have any questions about it. Texturing Test.vso
  11. The easiest way is to duplicate the symbol in the Resource Manager, that way the Lighting Info Record comes through intact. Duplicate the symbol, move the 2D geometry, then use the Replace Lighting Device button in the OIP to switch to the yoked out version.
  12. If you have the Instrument Type in the Lighting Info Record as the same for each symbol, they will count correctly in Lightwright. Lightwright treats the Instrument Type and Symbol Name as separate data exchange fields, so you can have multiple symbols of the same Instrument Type. I do this fairly often for different lamp types, so that Source 4s with 575w and 750w will have different symbols (750w with a gray cap and with the correct wattage listed in the Lighting Info Record), but will count correctly in Lightwright.
  13. While it's not the most elegant solution, one way that I've done this in the past is to create separate symbols based on yoke direction that has the 2D geometry of the symbol offset to appear on one side or the other, but keep the 3D geometry as is. That way you can use the 3D rotation section of the Lighting Device OIP to set the yoke and have it properly focus either through pan/tilt or by tying it to a Focus Point object.
  14. If you don't need the page breaks or watermarks to be visible while planning out your drawings, go to File - Page Setup and uncheck Show page boundary. This will turn all of those off. Otherwise, it sounds like you need set the page to be in landscape mode versus portrait. To do that, open up the Page Setup dialog as above and click on the Printer Setup button. You can then change the page size (Arch D for example) and toggle between Landscape and Portrait orientation. I would recommend making sure your page setup on your sheet layer has the correct paper size and orientation. If your page setup is correct for the final size of the printed sheet layer, you should not have any page breaks and only have one set of watermarks on the top and bottom of the page.
  15. The plug-in does not need to be event-based to hide control points. I usually have a boolean parameter to set whether the control point is "active", then just use SetCntrlPtVis(objHd,<control point #>,Pboolean) to show or hide it. Works like a charm.
×
×
  • Create New...