Jump to content

Jesse Cogswell

Member
  • Content Count

    31
  • Joined

  • Last visited

Posts posted by Jesse Cogswell


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

    • Like 1

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


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


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

    • Like 2

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


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


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

    1. Download the .vsm file.
    2. 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).
    3. Copy the downloaded .vsm file and paste it in the folder named "Plug-ins".
    4. Restart Vectorworks.
    5. In Vectorworks, open Tools-Workspaces-Edit Current Workspace.
    6. Select the Menus tab, and find the category labeled "JNC" in the left list box and expand it.
    7. Click and drag the Copy Viewport Settings menu command over to the target menu in the right list box.
    8. 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

     

    image.thumb.png.816b48a31d18644e0b9ad26d052df0f9.png

    Copy Viewport Settings.vsm

    • Like 2

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


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

    • Like 1

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

     

    752454816_EditLightingDeviceSingle.thumb.jpg.32cd527ba773de17676d646085a98187.jpg1430296128_EditLightingDeviceMultiple.thumb.jpg.dcc2fd278fbe85adc217aa4fc9389ac4.jpg


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


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


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


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


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

    Quote

    PROCEDURE GetDoorWindow;

    VAR

        trackHand:HANDLE;
        trackLoc:POINT3D;

    FUNCTION CheckObjCallback(h:HANDLE) : BOOLEAN;

    {Provides Callback for selecting Doors and Windows inserted into Walls}

        VAR
        
            recName:STRING;
            parentHand:HANDLE;
            
        BEGIN
            recName:=GetName(GetRecord(h,NumRecords(h)));
            parentHand:=GetParent(h);
            
            IF(((recName='Door') | (recName='Window')) & (GetTypeN(parentHand)=68)) THEN CheckObjCallback:=TRUE;
        END;

    BEGIN
        TrackObject(CheckObjCallback,trackHand,trackLoc.x,trackLoc.y,trackLoc.z);
    END;

    Run(GetDoorWindow);

     

     


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

    Quote

    PROCEDURE EditSymbol;

        VAR

            i:INTEGER;
            resList,numSymbols:LONGINT;
            symbolName:STRING;
            symbolHand,testHand:HANDLE;

        BEGIN
            symbolName:='Test Symbol 1';

            resList:=BuildResourceList(16,0,'',numSymbols);
                    
            FOR i:=1 TO numSymbols DO
                BEGIN
                    testHand:=GetResourceFromList(resList,i);
                    IF(GetName(testHand)=symbolName) THEN symbolHand:=testHand;
                END;

            Message(GetName(symbolHand));
            EditObjectSpecial(symbolHand,4);
        END;
        
    Run(EditSymbol);

     

    I'm also down for trying something different to get to the symbol editor if anyone has any ideas.

     

    - Jesse


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


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


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

    1. Program with a "Low Res" setting (800x600, everything set to low except Texture Quality so that I can see gobo edge settings)
    2. Open a blank Vision file and record the DMX
    3. Close and restart Vision
    4. Immediately render movie with a "High Res" setting at 25 FPS without touching anything else in the file
    5. 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.

    • Like 1

  20. Jesse,

     

    Just gave this a shot and had the same results.  The final video export is shorter than the original DMX file.  When syncing up the starting "blip" to 00:00:05:00, the final blackout occurs at 00:05:02:16 rather than 00:05:05:00 as it was originally programmed.

     

    Also, if this was the issue, how would it explain the difference in video length between 24 FPS and 30 FPS exports with the same DMX file (5:02 with 24 FPS, 5:08 with 30 FPS).

     

    New video file can be found here, new DMX file can be found here.

     

    Thank you again for looking into this.

     

    - Jesse Cogswell

 

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