Jump to content

Jesse Cogswell

  • Content Count

  • Joined

  • Last visited

Everything posted by Jesse Cogswell

  1. You should be able to set the "Adjust Flipped Text" setting using SetObjectVariableBoolean(viewportHandle,1029,TRUE/FALSE). No worries about the function reference, it's a tricky thing to navigate. There's so many things you can do using object variables, but it involves poring through the appendices. I've gotten pretty good at using Ctrl+F to find what I'm looking for.
  2. Peter is quite correct in that BuildResourceList will do the trick. 47 appears to be the Object Type for Record Formats. The one downside is that it will list the records for all plug-in objects in the drawing as well as the Record Formats in the Resource Manager, which can become a bit much if you have a lot of plug-in objects or different types in a drawing. Sample code I used to test is below. PROCEDURE GetRecordList; VAR recList,numRecords:LONGINT; i:INTEGER; test:STRING; BEGIN recList:=BuildResourceList(47,0,'',numRecords); FOR i:= 1 TO numRecords DO BEGIN test:=Concat(test,' | ',GetActualNameFromResourceList(recList,i)); END; Message('Num Records: ',numRecords,' ',test); END; Run(GetRecordList);
  3. @line-weight , ask and you shall receive. The script will now save the choice from the Attributes to Copy drop-down as well as the Update Viewports checkbox to a resource file and will recall those settings the next time you run the command. This is set globally, so these settings will be recalled regardless of which drawing you have open. Update Viewports will be unchecked by default the first time you run the tool. Copy Viewport Settings.vsm
  4. I had a problem with this in Vision 2021 as well. I ran the Update Dongle command in the Help menu and restarted Vision and it seemed to take care of the problem.
  5. @SamIWas , @line-weight mentioned in the original post that they have been using the eyedropper tool to do this, but it becomes very tedious if you have a large number of viewports spread across multiple sheet layers, the tool I wrote and posted above allows you to do it all in one go, and has the ability to force the viewports to run an update as well. @VectorGeek , The only thing that it does above and beyond the eyedropper tool is that it can apply to any number of viewports all at once. If you're copying settings from one viewport to, let's say, 10 other viewports spread across multiple sheet layers, that can take a little time. It also is a hair faster choosing between copying layer visibilities, class visibilities, or both since it's built into the dialog box, no need to open up the tool's settings menu and tick/untick a bunch of boxes.
  6. @Joan67 Not so fast! Designer is the full-featured version of VW, so it includes Landmark and Spotlight. So you should be covered as far as that is concerned. It also explains why you have the Spotlight menu commands. Did you check your Class Options? I'm trying to think if there are any other things that might cause this issue...could you try opening a new file and testing it there? Or you could upload a file and we could take a look at it.
  7. Is there a chance that the version of VW2020 that you are using is just the Fundamentals or Landmark version and doesn't have the Spotlight module installed? To quickly check, click on Help - About Vectorworks (on Windows), or About Vectorworks under the Apple menu on Mac (I believe, don't have an Apple machine in front of me). There is a category for "Licensed Products" and should include Spotlight. If Spotlight isn't there, then VW might not have the Lighting Device plug-in object necessary to handle the lighting fixture, though it's odd that you have the Spotlight menu options.... The other thing to look at is that your Class Options under the View menu is set to Show/Snap/Modify Others. There's a chance that you're on Active Only, so the different classes that make up the fixture symbols aren't visible.
  8. @line-weight That's interesting. When I run the command on 2019, it does not take me to a sheet layer (even if the command is run from a design layer) and renders the viewports one at a time. This is also consistent with selecting multiple viewports and pressing Update, VW does them one at a time for me. I had originally placed the UpdateVP command in the same procedure as applying the visibility changes, but now gave the update process a dedicated procedure so that all of the viewports update at once to see if it cleans up the process for you. Let me know if you see a change. Copy Viewport Settings.vsm
  9. @line-weight Good catch on the error if there are no viewports in the drawing. The command will now throw a notification if no viewports are detected. The dialog box will populate based on the viewport name (set in the Create Viewport dialog box, or edited in the "Name" field at the bottom of the Object Info Palette). If you're as lax as I am about naming viewports, this can be a bit confusing. The Drawing Title is not tied to Title Blocks, but is a separate field for all viewports in the Object Info Palette, which things like Drawing Label objects use when automatic drawing coordination is turned on. I added an "On Layer" column and "Drawing #" column to the list browser to aid in helping distinguish which viewport is which. The list browser will sort the viewports by layer, then drawing number automatically. I also added an "Update Viewports" checkbox, checked on by default. As for your idea of "presets" of visibilities similar to the publish command, it is certainly possible but that's getting into the point where I start billing you hourly. Vectorscript doesn't really have a way of doing drawing specific resource files, so I would have to store each "preset" as a worksheet and code in Classes and Layers visibility menus from scratch. It's certainly possible, but not really something I want to do on a tool I barely use without getting paid for it. Anyhow, updated file is attached. Just replace the file in the Plug-ins folder with this one and restart Vectorworks. Copy Viewport Settings.vsm
  10. @line-weight I just installed it on 2018 and ran a quick test without any problems. You should be good to go!
  11. @line-weight As Pat mentioned, translating things from saved views is really difficult as VW basically treats saved views as scripts, so pulling info can be difficult. As far as I know, there are no Vectorscript commands that will do the job. As for the viewport visibility option, I wrote up a script to do exactly that for a friend of mine. It opens a dialog box with a drop-down to select the viewport to copy, whether to copy layer settings, class settings, or both, and a list browser allowing you to select which viewports to copy the settings to. It will copy visibility as well as class overrides. I could not for the life of me get it to copy layer overrides, so if you need to do that, it would be best to use the eyedropper tool. It was written in Vectorscript in VW2019 and I've loosely tested it in 2021 (it's not one of my main plug-ins and isn't one I use too often myself, so I haven't done a full feature-by-feature test). It is attached to this message as "Copy Viewport Settings.vsm". The install process is a bit convoluted if you haven't done it before. Download the .vsm file. In Vectorworks, go to your Vectorworks Preferences, select the User Folder tab, and click the button labeled "Explore" (on Windows) or "Open in Finder" (on Mac). Copy the downloaded .vsm file and paste it in the folder named "Plug-ins". Restart Vectorworks. In Vectorworks, open Tools-Workspaces-Edit Current Workspace. Select the Menus tab, and find the category labeled "JNC" in the left list box and expand it. Click and drag the Copy Viewport Settings menu command over to the target menu in the right list box. Click OK. The menu command should now be in the designated menu. Let me know if something breaks or if you have any questions. The scripting itself isn't terribly complicated, but some of the components of the dialog box (IE, the List Browser) are terribly documented by VW and take a lot of trial and error to get right. If you would like, I can share the source code but would rather not on the public forum. - Jesse Copy Viewport Settings.vsm
  12. I've seen this more than a few times. According to support, this is caused by having a show file with more lights than your computer specs can render. The only solution I have found that seems to be reliable is to only export a movie IMMEDIATELY after opening the show file in Vision. Don't turn on any lights, make sure your console DMX is disconnected, don't render out a still before hand. Start Vision, open the file, load the DMX stream into the DMX Recorder, render video. I have found that if I turn on any lights before rendering, the export won't have the full compliment of fixtures. Which is super frustrating after spending an hour to export a movie.
  13. @A.D.K. Did you attach the Parts record to the clamp? It should be set as a Base. If a base object is already part of the fixture symbol, it usually works best to be in the same part (usually a group) as whatever is currently set as the base. I haven't done a ton of experimenting with this, but I think only one object wants to be assigned as a Base Part.
  14. Aha! Quite right. My muscle memory is stuck to using Ctrl+Alt+Shift+F to select a focus point, I'll just have to get used to double-clicking the selection instead. Actually, after playing with this for a bit, I think I discovered a bug with the Edit Lighting Device dialog. If only one fixture is selected, the dialog is shifted to one side, hiding the OK and Cancel buttons. It looks like they offset the elements of the dialog for having the Lighting Devices list browser (which doesn't appear if only one fixture is selected), but set the window dimension without it.
  15. Good morning. Just downloaded the new 2021 and am playing around with the Spotlight features. When I tried to focus the lighting fixtures, I discovered the new dialog box. Unless I'm missing something, there's not a way to select existing Focus Point objects in this window. While I certainly appreciate being able to focus a light without having to need a focus point, a big part of my design process is laying out my focus points first and using their location to place my lighting fixtures. I understand that I can still enter the information in manually in the Focus field of the Object Info Palette, I miss being able to set it from a list. Am I missing something with the new tool or has this functionality been removed? If it's been removed, could we file a feature request to add either a list box or pop-up menu to the Focus Lighting Devices dialog box? In the meantime, I've copied the original Focus Instruments plug-in from VW2020 as a workaround, but it would be lovely to be able to quickly focus fixtures with existing points without needing a second menu command. - Jesse
  16. @Pat Stanford , all of this makes sense in terms of the use of CreateCustomObject. Good to know that the object isn't drawn until script completion. My issue is specific to the Drawing Label object in that it uses "hidden" parameters to set the Num Config and LineMode on object creation and ignores the PIO defaults. I was able to find which hidden parameter affects the Num Config field, but I could not for the life of me find how to set the Line Mode to Auto-fit without having a second script run after the initial script creating the object. In the end, I just set the object to have a 2" fixed length. This is almost exactly the length needed to get the line to the end of the label's scale text, which is where the auto-fit would land anyway. At this point, it's more of a curiosity about whether it's possible to get auto-fit to work in the object creation script. The fact that it works if you check the "Create Drawing Label" box in the Create Viewport dialog suggests that it is indeed possible, but I don't know what kind of magic Vectorworks uses to make it happen.
  17. Good morning. I am working on a menu command that creates a series of viewports. I decided that I wanted to add an option to drop in a Drawing Label object into the annotation layer of these viewports but have run in to a couple of snags particular to the Drawing Label PIO. The first thing that I noticed was that when using CreateCustomObject to drop a Label in, the incoming label would ignore the defaults set in the Plug-in Manager. So I added some SetRField commands to set make the label fit my defaults, namely setting the "Num Config" field to "Drawing Only" and "LineMode" to "Auto-Fit," but these didn't seem to work, either. If I used an external script to change these later, they would change as intended. I did a little digging and found the hidden field "Config," changing this to "Config 4" would set the "Num Config" to "Drawing Only," but I can't seem to find a way to get "Auto-Fit" to work on a newly placed Drawing Label. I tried first setting the "Length" field to 0, using GetBBox to determine what the length needed to be and resetting the "Length" field to match, but the GetBBox only returns the coordinates of the Label's ControlPoint01 instead of the actual bounding box. My guess is the the Drawing Label object has some things buried in its code using IsNewCustomObject that prevents me from changing the needed fields until after the initial script completes. There must be some way of doing it, as the Create Viewport menu command has an option of adding a Drawing Label and it does so while following the Drawing Label defaults. Any ideas? - Jesse
  18. @JBenghiat Thank you for this, it certainly did the trick! The resource list was used in the larger code to populate a list box for selection and I didn't think to remove it when I scaled it down to test EditObjectSpecial.
  19. It determines how deep the track goes. If you are tracking objects that are inside of symbols or groups, that's how you would specify it. Somewhere deep in the function reference it describes the difference between shallow and deep traversal, but I couldn't find it last time I looked. I remember deep traversal going through all containers (walls, extrudes,sweeps,groups), but don't remember what shallow traversal specifies. Every time I've used TrackObject it's been to track something in design layer or sheet layer space, so no need to traverse at all. So I just use the standard TrackObject function. The documentation for Vectorscript is often times either very cryptic or straight up missing. I spent last week delving into the four different procedures/functions for offsetting a polygon and the documentation is laughable. I finally landed on using OffsetPolyN which offsets a polygon in document units instead of defaulting to millimeters, but doesn't close the resulting poly. The function reference has no example and just says, "Offsets a polygon or polyline. Uses Parasolid to do it. Equivalent of Voronoy based OffsetPoly." Which is still better than OffsetPoly, which reads more like a requirement doc than useful documentation: "Offsets a polygon or polyline. Must handle open & closed polys. A positive distance offsets to the outside; negative to the inside. Should remove self-intersecting segments from the result. Should support smooth vs. sharp offsets."
  20. Don't know about TrackObjectN, in this instance I don't know if you would really need the traversal specification, but here's a short script that works for doors and windows that are embedded in walls:
  21. Good morning, I am working on a PIO that can use a symbol as base geometry so that users can have further customization. Is there a way to make the double-click behavior of the PIO edit the reference symbol? I've added all of the requisite commands for the double-click special edit and to pull the handle of the referenced symbol definition, but can't find a command to open up the symbol editor for the symbol definition. I tried EditObjectSpecial(symDefHand,4), but it keeps thinking I'm trying to edit the PIO instead. If I change the editMode to 2 (Properties), it opens up the properties pane for the PIO, not the referenced symbol. I did a few tests by playing around with the EditObjectSpecial procedure inside some temp scripts. It worked perfectly for editing symbols but only if I had a symbol selected before running, and even then it would edit the selected symbol rather than the symbol definition passed into EditObjectSpecial. If nothing is selected, the script doesn't do anything. I can even pass in an empty handle as long as something is selected before running the script. I've tried it in 2018, 2019, and 2020 with the same results. Do we think that this is a bug or am I misreading its need for a passed handle? For those playing along at home, my test script is as follows: I'm also down for trying something different to get to the symbol editor if anyone has any ideas. - Jesse
  22. Good morning and thank you for the reply @MullinRJ , I currently use VW 2019 for script development (since it's the version I'm happiest with) and 2020 for testing. In 2019, I can add a popup field to a record format with no problem using the Resource Manager, same for 2020 and as far back as 2018 (earliest version I have installed). The issue I am having is that there seems no way to build a record with a popup field strictly through scripting, in 2019 or 2020. I have a plug-in that wants to reference a symbol, so the easiest way is to attach a record to that symbol. But, that record will need to exist within the drawing, so I was hoping to be able to create it from scratch as part of the plug-in's code when it is needed. The plug-in has a couple of different types, so it would be great if the type could be assigned to the symbol using a popup field to decrease the chance of user-error. At the end of the day, it's really not a problem for me to use a text field for this, which is ultimately what I am going to end up doing. Especially because it will allow for backwards compatibility for earlier versions of Vectorworks. Jesse
  23. Good morning. I'm trying to create a record format containing pop-up fields using Vectorscript and have yet to be successful. The appendix contains a section "Record - Worksheet Field Types" which does not contain popup menus as well as a "Plug-in Object Parameter Record Field Types" section which lists Text - Popup Menu Item with a selector of 8 (the same as Number - Fractional in the other list). If I try building a record format through the Resource Manager and reverse engineering it with GetFldType, a popup field returns a value of 8, but so does a Number - Fractional value. Is this something that just isn't possible with Vectorscript?
  24. After switching to exporting at 25 FPS, I have had no issues with the time dilation, making Premier setup a breeze and the final export from Premier faster and cleaner. As for fixtures disappearing during rendering, I have had the best luck with starting the render process immediately after opening the file without turning on lights or rendering a still first, as many times I've rendered the still first with no problems only to have the two hour rendered movie missing whole fixture groups. My standard work flow has been as follows: Program with a "Low Res" setting (800x600, everything set to low except Texture Quality so that I can see gobo edge settings) Open a blank Vision file and record the DMX Close and restart Vision Immediately render movie with a "High Res" setting at 25 FPS without touching anything else in the file Use Premier to sync up sound and do final export I have also found that I have had higher success in exporting if I have my battery settings set to "Best Performance" before opening up Vision to do video rendering.


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