Jump to content

Pat Stanford

Moderator
  • Posts

    12,532
  • Joined

  • Last visited

Posts posted by Pat Stanford

  1. The default workspaces don't have any keyboard shortcut for this. If yours does, you can edit your Workspace to remove it. Or to be even safer, not only remove the keyboard shortcut, but bury the command a level deeper, possibly under the Close menu command so you are unlikely to accidentally click on it in the menu.

     

    But when I use Revert to Saved in VW2021, I get a warning dialog box.

  2. Vectorworks has what were originally called "2-way worksheets". Any cell in a database that displays Record.Field information can be edited in the worksheet and the data will be stored in the Record. If you change the data in the Record in the Object Info Palette, the next time the worksheet recalculates the data in the worksheet will be updated with the most current information from the record.

     

    You are not able to enter any data in a database cell unless that cell contains Record.Field data. So if you just want to add a note, you will have to add another Record.Field or repurpose a different field.

     

    HTH

  3. Can you please try it again and see if it is repeatable. If it is repeatable,  please send the file, the steps to reproduce, and as much detail about your system setup as possible to Tech Support so they can try to replicate the problem.

     

    It could be a bug, but it is not an issue I have heard of before, so it is likely an edge case or a one time glitch.

  4. Josh is correct that you are going to need to use some kind of loop and assign the data to a single object at a time. The question is what is the easiest way to get the objects you want.

     

    Since you said you want to use "database attributes" I think you mean Criteria. If that is the case, then the ForEachObject procedure is your friend.

     

    Simplified psuedocode below:

    Procedure Demo;
    
    Procedure CalledProc(H1:Handle);
    Begin
      SetRField(H1, YourRecord, YourField);
    End
    
    Begin
      ForEachObject(CalledProc, YourCriteriaGoHere);
    End;
    
    Run(Demo)

    Create a sub procedure in your main procedure that takes a single handle. (CalledProc)

    Use ForEachObject to repeatedly call the sub procedure once for each object returned by the criteria (passing the handle as the object for CalledProc to process.

     

    HTH

    • Like 1
  5. Two places to check.

     

    1. Quick Preferences in the Mode Bar. Look for the brown rectangle icon with the eye. If it does not show click the disclosure triangle on the right and turn it on as one of your quick prefs.

    image.thumb.png.f1456dca45993a19c42d9b7584dd73ed.png

     

    2. Vectorworks Preferences:Display Tab: Make sure Show Other Objects While In Editing Modes it checked and if you prefer also the Gray Other Objects.

    image.thumb.png.ec0402c77e5270e8d8556409dd9c6ee1.png

  6. I don't know of a way around this, but I consider this a bug. If the rest of the parameters are being retained, then the users choice should be remembered for Open in Default Viewer also.

     

    Maybe for SP3 (SP2 if we are REALLY lucky, SP99 if we are unlucky.)

     

    As Raymond suggested, you could probably write a script that would generate a text file from the contents of your worksheet as an alternative. If you did that you could eliminate the dialog box all together and just hard code the file to write the data to.

  7. The keyboard shortcut in the default workspaces is Command-Option-L. If you are hitting that accidentally, you could edit your workspace and remove the keyboard shortcut. I rarely (read never) turn off Unified View any more. Now, watch me need to turn it off for something today. ;-)

    • Like 1
  8. Check in the View menu and make sure you have Unified View turned on. With Unified View turned on, all of the design layers at the same scale as the active layer change views together. With Unified View turned off, only the active layer changes views and everything else stays in whatever view it was set to.

    • Like 1
  9. If you are only using the Civil 3D (or any DWG file for that matter) as a background for your other work and don't need to edit it, one option is to import it into a separate VW file and then reference that file into your primary drawing. This will isolate the complexity of the file and not "contaminate" your primary file with all of the DWG Layers (VW Classes) as they will be contained within the reference.

     

    I can't remember for sure, but you may be able to do this directly with a Referenced Design Layer Viewport from the DWG and never have to convert the file to VW.

     

    • Like 1
  10. Update. I THINK there is a bug and I have submitted it as such.

     

    Basically the idea behind DatabaseByScript is that you run a script and in that script you do whatever you want to determine what objects you want displayed in the database. You are not limited to the standard criteria. They can even be different types of objects. This functionality was originally added in VW2020 to allow Landmark users to generate a schedule that would display the Landscape Area name before the list of plants that are in that area.

     

    In VW2020 a Vectorscript command WSScript_AddHandle was added. Your DatabaseByScript script would figure out what objects to include and what order to include them in and then you would pass the handle to each object to the WSScript_AddHandle(YourHandle) and the database was created. Recalculate the worksheet and the script would run again.

     

    In VW2021, in addition to the AddHandle a new function WSScript_AddHandleId that lets you add an ID (that I don't know what it is used for) to the returned value also.

     

    But in the initial release (and the Beta of SP2), if you use AddHandle, or AddHandleId with an incrementing ID, only about 1/2 the desired items are returned. The workaround is to use WSScript_AddHandleId with a fixed ID.

     

    The script has been parameterized to let the user specify the Record name, the Field name, the minimum value to return and the maximum value to return. The Field should contain a string representation of an integer. The only error checking the script does it to make sure the Field for each object contains a valid number. If the field contains a valid number then it converts the string to an integer and checks if it is in the range of the min and max (inclusive). Any items that meet the range are returned in the database.

     

    Once you get the database sub-items defined you can use all of the standard worksheet functions to display information about the objects, Record.Field combinations, SUMmarize item and Sum Values.

     

    There appears to be another bug I have not had time to fully research yet, but it looks like the first item returned is not SUMmarizing even if the column you are SUMing on is the same as other rows. 

     

    I have attached a sample file showing both Lighting Devices and also 5 rectangles with a custom record/field combination of PTS.MKS that I was using for testing.

     

    Here is the script. Copy everything inside the Code block and paste into a new blank script in VW named 


    StringField_By_Range

     

    To enter the script convert a worksheet row to a database and accept whatever default criteria come up. Then right click on the database header row and choose Edit Database Formula. Enter the following to set a range of Lighting Device Channel numbers to display.

     

    =DATABASEBYSCRIPT('StringField_By_Range', 'Lighting Device', 'Channel', 4, 105)

     

    In the above, 4 is the Min channel to display and 105 is the Max channel. Change those two as you see fit. If you have other objects that have a numeric field stored as a string you can change the Record and Field names above to work with them.

     

    Procedure StringField_By_Range;
    
    {October 3, 2020}
    {©2020 Patrick Stanford pat@coviana.com}
    {Licensed under the GNU Lesser General Public License}
    
    {No Warranty Expressed of Implied. Use at your own risk.}
    
    {A sample script to show how to use the DatabaseByScript}
    {functionality in a worksheet to create your own objects when}
    {the standard criteria are not enough.}
    
    {This was originally developed to allow the generation of a}
    {subset of objects (Lighting Device) which had a field that was}
    {formatted as a sting, but the user was using as numeric data.}
    {The desire was to get a subset of the channels using a Min and Max}
    {value. Since the data was a string, a simple Greater Than or}
    {Less Than would not work.}
    
    {This script is run from the Database Formula Bar using a syntax of:}
    {=DatabaseByScript('StringField_By_Range', 'Lighting Device', 'Channel',}
    {    Min Channel Number, Max Channel Number)}
    
    {where Min Channel Number and Max Channel Number are Integers}
    
    {Procedure Execute does the heavy lifting. It converts the string}
    {representation of the number to an Integer. It then compares that}
    {Integer to the passed Min and Max Values. If the Integer is in}
    {the range then it adds the object to the database.}
    
    {The main body of the code only gets the parameters that are}
    {passed to the script and uses the passed Record & Field}
    {as Criteria in the ForEachObject procedure. ForEachObject}
    {gets a Handle for each object that matches the criteria}
    {and passes the handle to that object to the Execute procedure.}
    {As written, the only criteria is that the object has the}
    {passed Record (TheRecord) attached. The criteria in the }
    {ForEachObject line can be changed as necessary to return}
    {only the correct objects.}
    
    {The only error checking in this script is that the data in}
    {the field passes as TheField actually converts to a valid}
    {number.}
    
    {Do not operate heavy machinery or drive an automobile}
    {while using this script. If use causes excessive itching or }
    {unexplainable hair loss, discontinue use immediately and see}
    {a programmer immediately.}
    
    
    Var	CMax, CMin, CInteger: Integer;
    	TheRecord, TheField: String;
    	B1:	Boolean;
    
    Procedure Execute(Hd1:Handle);
    {Converts the value in TheRecord.TheField combination to a number}
    {If it is a valid number then it compares the data to CMin and CMax}
    {If the value is in the desired range, then add the object specified}
    {by Hd1 to the database}
    
    	Begin
    		B1:=ValidNumStr(GetRField(Hd1,TheRecord,TheField), CInteger);
    {AlrtDialog(Concat(Hd1,'  ',CInteger, '  ', B1,'  ',CMin,'  ',CMax,'  ',CInteger>=CMin,'  ',CInteger<=CMax));
    }		If (B1 & (CInteger >= CMin) & (CInteger <= CMax)) Then
    		Begin
    			WSScript_AddHandleID(Hd1,1);
    			{As of VW2021 SP2Beta1, AddHandle and AddHandleId used with}
    			{a variable ID only return a portion of the expected results}
    			{Using a fixed ID of 1 appears to return the correct items.}
    {			AlrtDialog(Concat(CInteger));} {AlrtDialog added for debugging}
    		End;
    	End;
    	
    Begin
    {Get the parameters passed top the script}
    	TheRecord:=WSScript_GetPrmStr(0);
    	TheField:=WSScript_GetPrmStr(1);
    {Record and Field are separate parameters because "escaping" the}
    {quotes properly to pass as a single Record.Field pair}
    {makes the script call almost unreadable}
    	CMin:=WSScript_GetPrmInt(2);
    	CMax:=WSScript_GetPrmInt(3);
    	
    {Change the criteria in the next line to identify only the}
    {objects that any chance of being in the database. Additional}
    {criteria like, Layer, Class, In Symbol Definition, etc. would}
    {be typical. If you use the criteria builder, you probably}
    {want to edit the generated criteria string to use the variables}
    {TheRecord and TheField rather than hardcoded Record and Field}
    {names. This will provide additional flexibility for future use}
    {if you need to change the Record and field. They will only have}
    {to be changed in the DatabaseByScript call instead of editing}
    {the script.}	
    	ForEachObject(Execute, ((R IN [TheRecord])));
    End;
    
    Run(Stringfield_By_Range);

    Ask again where I have not been clear.

  11. The only way to show real world (scaled) dimension on a sheet layer is to work on the part of the sheet layer that is already scaled. The Viewport.

     

    Double Click on the Viewport and choose to edit the Annotations. Any dimensions that you draw in the Annotations group will use the scale of Viewport.

     

    If you draw dimensions in Annotations and then change the scale of the viewport, the dimension will remain in the correct places and will scale with the viewport.

     

    If you place dimensions in Annotations and get the small green squares that indicate Associated Dimensions, you can then double click those dimensions and change the dimension value and the objects will move on the design layer to the new location specified. You can only (??) associate dimensions with corner points (or at least snap points) of objects and get this to work. If you have Associated Dimensions and your move an object on the Design Layer, the Associated Dimension in the Viewport will follow the move and automatically update.

     

    Ask again if you need more information.

    • Like 1
  12. Unless you are using Stories, and are using the default Wall Styles that ship with VW, make sure you select Walls from the Imperial Fixed Height Walls or Metric Fixed Height Walls rather than the Story Bounded versions and you will be much happier.

     

    You can make either work, but it is just easier if you don't fight stories if you don't need them.

    • Like 1
  13. Yes, the Education watermark is not removable for general purposes.

     

    VW offers a Student to Pro package where they will remove the watermark from all your files for you when you graduate (and I think buy a license).

     

    If this is for a special purpose, you might convince them to unlock a drawing or two for you early. Contact Customer Support.

  14. Yep, it looks like you can't use a Value command in a database formula.

     

    What might make your work around easier is to use Question Marks (?) as wildcards for a single character.

     

    =DATABASE((('Lighting Device'.'Channel'<='1?')) will return all of the object that have only two characters and start with the number 1.

     

    1?? will return all of the channels with three characters that start with the number 1.

     

    So instead of having to do ORs for 1 to 99 you could just do ORs for 1?, 2?, .... 9?.

     

    At least a little easier.

     

    VW2020 also added a new function called Database By Script that could be useful here. Let me see if I can make that work and I will post it.

×
×
  • Create New...