Jump to content

Pat Stanford

Moderator
  • Posts

    12,682
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. 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
  2. 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. 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.
  3. 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.
  4. 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. ;-)
  5. 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.
  6. I believe the Stake object can report the heights of surfaces. You should be able to place them in Top/Plan view and then Send to Surface. Hopefully someone with more direct experience will help us both out.
  7. 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.
  8. 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.
  9. 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.
  10. And for everything in one place: http://app-help.vectorworks.net/2021/eng/Commands_Tools2021.pdf http://app-help.vectorworks.net/2020/eng/Commands_Tools2020.pdf http://app-help.vectorworks.net/2019/eng/Commands_Tools2019.pdf http://app-help.vectorworks.net/2018/eng/Commands_Tools2018.pdf http://app-help.vectorworks.net/2017/eng/Commands_Tools2017.pdf http://app-help.vectorworks.net/2016/eng/Commands_Tools2016.pdf
  11. What version of VW is this? Renderworks has been included in all versions of VW since at least VW2017. Have you tried restarting VW? Have you tried restarting the computer? If neither of the above work, try reinstalling VW.
  12. I am working on a demo right now, but think I have found a bug. More details later today.
  13. 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.
  14. 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.
  15. 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.
  16. Pat Stanford

    Tool Set

    Oh, are we still playing? ;-) I will give you all a kind of head start this week. I am traveling to the each coast and will be away from the computer Tues/Wed/Thurs and on planes Mon/Friday. But I will be on the East Coast so I will have a 3 hour head start on the CA contingent. On your mark, get set, GO!
  17. In Vectorscript (and probably all of VW), Integers (and LongInts) are a subset of Reals. That means that anywhere a real is specified you can also use an Int or LongInt. If a LongInt is required you can use either an Integer or a LongInt. If an Integer is required, you can only use an Integer (unless someone else wants to do the multiple paragraph explanation of how a Boolean is really an subset of integer and can be used....). ;-)
  18. Go to Vectorworks Preferences:Autosave pane. Do you have it set to automatically save every 10 minutes? Is it saving to a very slow drive and/or to the cloud so the save it taking a long time? I normally recommend that you set the autosave to a certain number of Operations rather than minutes. That way the Autosave kicks in between operations and not in the middle of your doing a single operation. While you are there, also make sure you set it to Autosave a Backup Copy instead of Overwrite Original. I have all of my backups go to a single folder on my local hard disk and I save the most recent 12 backups. But that was something I picked a long time ago. Considering that I am currently only using 700Gig on a 2TB drive, I should probably bump that number up. I don't use VW that heavily, but my backup folder is only 9.3GB for 353 backup files running back to April of 2020. The nice thing about having all the backups in one place is you can easily go in and purge the backups for a file when you are done with the project and have made proper backups and archive copies. These autosave copies are really only there as snapshots in case you crash or the occasional time when you run out of undos after making a big boo boo. HTH
  19. While there are always a few people who have issues with their specific setups and that are often difficult to track down, in general, 99+% of the users of VW are not seeing the issues that are being discussed in these types of posts. Pure guess on my part, but my gut tells me that about 50% of the people who make posts like this are helped either here on the forum or directly by Tech support. About 40% (of the very small starting number) choose to give up on VW and move on to something else. The other 10% find a way to deal with the issues without ever fixing them. And it is interesting to me that you are asking about the speed of a 6 year old version of the software. VW2021 was just released. If you do choose to go with VW2015, the amount of help you are going to get here on the forum will be limited. There are a lot of people here who have started in the last 5 years and never ran 2015. There are even more people who have used 6 versions in between and don't remember and probably don't have a way to test any problem you are seeing. Unless you have one of the following situations, you will be much happier with a newer (preferably newest) version. 1. You have a very old computer that you can't upgrade that you must run VW on and are only going to be an intermittent and light user. 2. You already have a copy of VW2015 (and a computer it will run on) and don't want to spend any money. 3. You have someone who is offering you a great deal (maybe $100) for a copy of VW2015 and some version of 1 and 2 also apply. 4. You really don't need to work in VW, but just want something to use for hobby drawings for your own use and don't really care about performance. All opinions above are my persons opinions and are not intended to represent my position as a volunteer moderator of the forum.
  20. I don't believe there is a 3D equivalent of PtInPoly. I can think of a couple of possible work arounds. Perhaps someone else will have a better solution. 1. Extract Surfaces from a Top and Elevation view of the volume you are interested in and then use PtInPoly to see if the point is in both. If it is, then you have your answer. 2. If the volume in question is a Solid, then create another small solid and place it at the point in question and Intersect Solids. If you get anything other than a NIL handle returned then the small solid at least partially overlaps with the original solid. 3. ??? Batter Up!!
  21. Pat Stanford

    Tool Set

    Vectorworks is a very deep program and used in many different industries in many different ways. A short (couple of day) course can only expose you to the basics of the workflow the instructor is teaching. You are right, you will need to take the time to learn the parts of VW that work the way you want to work. If something does not work for you, don't use it and figure out what works best for you. This forum is the best place to ask questions and get help in figuring out what will work best for you. There was a teacher in Los Angeles who started teaching VW predecessor, MiniCAD, a long time ago. When Classes were added, she did not want to have to redo her book or classes, so the first thing she said in her classes was that she thought Classes were a bad thing and that no one should use them. I thought (and think) she was wrong. Just because someone is teaching a class does not mean that you should do everything exactly as they say after you are out of class. IMNSHO.
  22. Can you post a file with a few lights in it. I don't really have time to create a plot to play with, but I would be happy to play with the database criteria and see if we can make something work.
  23. Sheet Layers have a 1:1 scale (outside of viewports. Inside viewports you can set the scale for each viewport). If you Design Layer is something other than 1:1, then when you put is on a sheet layer it will display strangely.
  24. What happens if you edit your original formula to use just 100 without the quote marks around it? The Value statement should give you a number and you have to compare a number to a number. Also, does Lighting Device.Channel ONLY contain the "number"? If there is anything other than characters 0-9 in the field, then the Value statement won't work. I THINK that even an extra space at the beginning or end will cause the Value to fail.
  25. Working as Designed (WAD) means that the codes does what the task specification that was given to the programmer says it should do. It does not mean that the object functions the way the user wants it to. If you don't agree that the specification was correct, you need to submit an enhancement request (rather than a Bug Submit) to see if you can get VW to reevaluate the task and change the behavior of the object. In this case I would tend to agree with @SMannVW that the text should scale with the markers and the better option from the users standpoint is to create different Styles for different scaling options. But I rarely use markers, so what do I know. If you and enough other users see this as a problem it will probably get changed in a future version. Or perhaps you can go back to the Legacy Marker styles by editing your workspace if they work better for you.
×
×
  • Create New...