Jump to content

Pat Stanford

Moderator
  • Posts

    12,711
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. You were getting the record from the Space and not from the Parent of the space. See the changes below. Untested, but it should work. Procedure GetExampleFieldFromSpaceToWS; {February 1, 2024} {Custom script to get a field (ExampleField) value from a record attached to the parent symbol of a Space object.} {February 3, 2024 Updated by Pat Stanford } Var spaceHandle: Handle; recordName: String; fieldValue: String; Begin { Get the handle of the current Space object } spaceHandle := WSScript_GetObject; If GetTypeN(GetParent(spaceHandle)) <> 31 then {Added GetParent} Begin { Specify the record name and field to retrieve } recordName := 'ExampleRecord'; fieldValue := GetRField(GetParent(spaceHandle), recordName, 'ExampleField'); {Added GetParent} { Set the result to the worksheet cell } WSScript_SetResStr(fieldValue); End Else Begin WSScript_SetResStr('Not a Space object'); End; End; Run(GetExampleFieldFromSpaceToWS);
  2. Here is a script that should do what you want. Be careful as it will select text blocks that match the criteria but are not currently visible (hidden layers or classes). By commenting/uncommenting different lines, you can change the behavior of the script from an Exact Match to Begins With to Contains. Only one line can be uncommented at a time. As written below it does an exact match. Ask if you have more questions. Procedure SelectTextByWorksheetCell; {©2024 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {This script takes the value of the selected cell in the top visible worksheet (open for editing)} {and then searches for text blocks in the drawing that have that value.} {In a file with many text block this could be a very slow operation.} {The script has three modes that can be set by changing which line is uncommented.} {Comment a line by placing braces (the characters at the beginning and end of this Line)} {at the beginning and end of the line. Uncomment a line by removing the braces.} {Only one of the three lines can be uncommmented at a time.} {If the first line is uncommented, the script will select items that are an EXACT MATCH} {for the value in the currently selected worksheet cell.} {If the secon line is uncommented, the script will select text items that BEGIN with} {the string in the currently selected worksheet cell.} {If the third line is uncommented, the script will select items that CONTAIN the string} {in the currenlty selected worksheet cell.} {This script can be slighty dangerous as it will select text items that match the Criteria} {but that are not currenlty visible, including text blocks on other layers or invisible} {classes. Be careful if you are using this to select items to modify or delete.} VAR WSHand, TextHand :Handle; Row1, Col1, N1 :Integer; WSString, TextString :DynArray of Char; Procedure Execute(Hd1:Handle); BEGIN If GetType(Hd1)=10 THEN BEGIN TextString:=GetText(Hd1); If TextString=WSString THEN (*Uncomment this line for exact match *) { If Pos(WSString, TextString)=1 THEN (*Uncomment this line for Begins With *) } { If POS(WSString, TextString)>0 THEN (*Uncomment this line for Contains *) } BEGIN SetSelect(Hd1); End; End; End; BEGIN DSelectAll; WSHand:=GetTopVisibleWS; GetWSSelection(WSHand, Row1, Col1, N1, N1, N1, N1, N1, N1); GetWSCellStringN(WSHand, Row1, Col1, WSString); ForEachObject(Execute, ((T=TEXT))); End; Run(SelectTextByWorksheetCell); Select Text By Worksheet Cell.vwx
  3. You have already extruded the object, but with zero extrusion depth. Just change the value in the Extra: field in the Object Info Palette (OIP). You will also want to set the attributes for the object to have a Solid fill instead of None or else you will only get the edges with nothing between.
  4. One thing to try would be to change the resolution of your monitor to something lower (maybe as far down as 1024x768). Then try to replace a symbol. This should force the window to resize to fit on the monitor. You can then go back to your normal resolution and the window should stay small so you can resize it to your liking. If that does not work, try resetting your preferences (I am not certain if the window sizes are saved in the prefs file or not) and/or quitting VW, renaming your User Folder, and restarting VW. This should cause a new version of the User Folder to be created with the default settings. If this works you can then copy anything you need into the new user folder. Good luck.
  5. @AStein Autoplot is not A tool, it is a host of tools to handle many (most) of the issues involved in getting lighting plots right. Bite the bullet and buy the thing. Something in the kit will save you 10 hours over the next year. A significant return on your investment. And Sam offers great support.
  6. You are not going to have much luck in fixing it in a Worksheet. Worksheets don't offer very much control over how they display images of objects. The better option is probably going to be to look at using a Graphical Legend instead of a worksheet.
  7. One of the options for a symbol is to Insert as Group. That breaks the link between the symbol definition and the instance. But it also make for large files and longer render times as every instance has to be calculated separately. If you always want your symbols to insert as groups, you will need to find the symbol in the Resource Manager and Edit Symbol Options and make sure the Convert to Group is checked. Or if you like the groups, but occasionally need to change one, you can select that object and us the Modify Menu:Convert:Convert to Group. This will effective do the same as the Symbol Options version, but only for that one instance.
  8. @ASydDesigns please confirm what version of VW you are using. Your signature says you are using VW2022. Spaces and Space Labels changed in VW2023, so the answer will depend on the version you are running.
  9. Post the file or DM it to me and I will take a look.
  10. Are we working with just the Parent of the object, or do we need to consider objects in Walls where the Parent is actually a symbol containing the Wall? Once you have a handle to the object you want, it is very easy to get the Record.Field. If H1 is the handle to the object your want then something like the following where S1 is defined as a string will get the data: S1:=GetRField(H1, 'ExampleRecord', 'ExampleField');
  11. There are a number of us who think small scripts are a fun distraction. 😉
  12. I also crash when exporting your file to STEP. It is the Solid Addition on the left that is the problem. Remove it and the files does not crash. I tried converting it to a Generic Solid but still got the crash. I recommend you submit the file, or better yet a file with just that one part as a bug since it produces a reliable crash. Since this is a Student version file, I am not certain if you can contact Technical Support or if it is only support through the Student Portal, but if you have time you might want to submit the file or the part to Support and see if they can see what is causing the crash. If you find an answer, please post it back here for others to learn from.
  13. A Viewport on a Design Layer will take on the settings of that Layer for the view. Are you really running VW2018 as your signature says? If so, then you could turn off Unified View so you can have different views for each design layer and put your model on a layer in Front view and a layer in Top/Plan over the top that you could use for your other things. But as you say, this is probably better done in Annotations in a Sheet Layer Viewport.
  14. It is a mess. 😞 Most of the functions/procedures don't actually exist (GetWSByName, GetWSCellNumRows, FindText) and the ones that do exist are being used incorrectly. Why don't you ask the OI (Online Intelligence: i.e. this forum) what you are trying to do and you will get much better results.
  15. Thanks for the update. One more note to stick in my brain for future troubleshooting.
  16. Even weirder, earlier today I converted a 3D extrude to a symbol to the lower right of the origin and it worked correctly. After @rDesigns post I tried it again, but to the upper left of the origin and got the symbol created with the origin at 0,0 like everyone else. I then did another one to the lower right and still got a 0,0 origin. This is in the same file. Currently is has 2 NURBs curves and 7 symbols used in testing this. Very strange.
  17. Correct. They are close to center (20-30' at 1:48 (1/4") scale.
  18. MacBook Pro, M3, OS14.2.1. Working with 2D objects only. I just tried with a 3D object and a hybrid (Extruded Octagon with 2D Octagon) and both of them worked exactly as I expected. 🤷‍♂️
  19. Like I said, I just tried in Update 3.1 and I am not seeing the problem. I wonder what is different in our installs. When I create a symbol and tell it to leave the instance in place the symbol creates with the origin at the center of the object and the OIP showing the correct distance from the origin.
  20. @Tom W. The behavior you describe is what Kevin is expecting but not what he is seeing. I am not seeing that anomalous result in VW2024 Update 3.1. @Kevin McAllister Have you tried restarting your computer and VW?
  21. It looks pretty specifically like there is an object named "Cabinets" with the S. Not sure what it is or why you can't copy cabinets between files. I may have some time to research tonight.
  22. I just tested in a simple file and for me it is providing the Fill Background Color. Can you DM me a file that I can take a look at an see what is going on?
  23. Do you have a Class named Cabinets? Or any other object? Only a single object can have a specific name. Maybe the error message is lying to you about it being a folder. I just tried to name a NURNS curve in a new blank file "Cabinets" and got the following error message: Not sure why or what that means. There are not folders and only two objects in the entire drawing.
  24. I think your only choices (and I am saying this so that someone else will prove me wrong with a better way 😉) are to use DoMenuTextByBName to access Combine/Connect or to walk the existing NURBS curves and create a new one from the data you have collected. I tested and CombinePolygons does not work with NURBS.
  25. The script in the linked thread creates a VW Worksheet with an alphabetical list of the classes in the file. The post above has one that exports them in the Nav Palette default order. The one at the bottom is dynamic, so you can't move it into a file without classes, but it also shows the attribute colors of the class.
×
×
  • Create New...