Jump to content

Jesse Cogswell

Member
  • Posts

    332
  • Joined

  • Last visited

Reputation

320 Spectacular

6 Followers

Personal Information

  • Location
    United States

Recent Profile Visitors

1,820 profile views
  1. Nope. The extrude was just used to reference 0'-0" elevation. The user origin was set using Tools - Origin - User Origin. Here's some screenshots with an example: Initial setup with a 6' extrude with bottom Z at 0'-0": Front view. Rulers properly match up: Setting User Origin to upper left corner of extrude: Front view. Z-Axis ruler no longer matches proper elevation: Reset User Origin to Internal Origin: Z-Axis ruler properly showing elevation again: The user origin is a tricky thing on the coding side of Vectorworks. ALL of the scripting commands reference the Internal Origin, with a proper command for getting the user origin being added in 2016. Before then, you had to get the user origin using document preference variables and recalculate them to drawing units (the preference variable would be in millimeters), so there was a decent room for error. After I started scripting things, I became VERY cognizant of where my Internal Origin is and very rarely use User Origins. I suspect that the Z-axis ruler has a bug where its not properly calculating when a User Origin is different than the Internal Origin. Which I find very interesting as the User Origin has no Z-axis setting at all.
  2. I did some tests and think I figured it out. Open up a new file and draw a 3D object (like an extrude). If you go to a front view, you'll see that the 0' ruler mark lines up properly. However, if you set a user origin, the ruler seems to no longer properly align in orthographic views. If you reset your user origin back to the internal origin, it lines up correctly again. There's likely a bug with the user origin (as per usual) and the ruler not updating properly.
  3. You have to add INVIEWPORT to the selection criteria. Likewise, if you want to select objects while editing a symbol, you would need to add INSYMBOL. You have to be kind of careful with these, as they can have unintended consequences. Objects remain selected while inside edit containers like symbols, groups, and viewport annotations, and VSEL isn't as restrictive as it maybe should be. So if you have a script, say, delete objects you might accidentally delete objects out of viewport annotations that you didn't realize were still selected.
  4. 12 or so years ago I used a Razer Nostromo gamepad for this (now it's the Razer Tartarus, nicer but same button layout). I'm left handed, but use a mouse with my right hand, so it worked really well for getting away from using the keyboard. I recall it having 7 or 8 different layouts per application, so I had it set up that I could roll through them with the scroll wheel and had a different layout for different functions (one for views, one for data entry / basic tools, one for 3D modeling, one for Spotlight, etc). I used it extensively for two years or so until I got a new laptop. The profiles are now tied to the cloud, but they weren't back then, and I didn't feel like rebuilding the profile. So I put it in a drawer, where it lives to this day.
  5. @rebu1985 I have been unable to recreate your issue, even after building a duplicate scenario as you have in your images above. Please answer the following questions, and be as clear and specific as you can be. The more information you provide, the faster I can get this bug fixed. Do you get the error when you run the menu command or after interacting with the dialog box? If it happens after interacting with the dialog, what specific actions did you do between the dialog box popping up and the error message? In the four images above, what specifically changed between the first two images and the second two images? In the second two images, what is your active layer? Are there objects on that layer? I can see that you have three design layers but that all of the objects are on Design Layer-1 in the images where the script is working. Can you confirm that you are using the "most current" version of this tool? It would be the one found in the June 3rd post above which DOES NOT have a screen shot image. I did a lot of testing on this plug-in to try to eliminate the chances of these types of errors, and I have folded the tool into my general workflow (it's completely replaced Custom Selection for me, as I find it much easier to use compared to the reworked command in VW2022) and have not seen this error. @MarcelP102 or any other users, have you run into any errors or issues with the tool? MODERATORS: would it be possible to remove the attachments to my messages that contain earlier versions of the tool? I used to be able to edit my posts to swap the attached script with the most current version, but it seems that I am no longer able to edit any of my posts that have an attachment.
  6. @scottmoore Good catch with symbols. I added a line to reset symbols matching the new name. It should work with embedded symbols and symbols in groups and such. In testing, I did find a couple of potential dangers of this tool, mainly with renaming symbol definitions that are being used inside plug-in objects, as renaming the symbol won't pass the new name in to the PIOs. It's nothing outside behavior similar to renaming a symbol through the Resource Manager, but it is something you need to keep in mind. I also discovered a bug with renaming Resource Manager folders with this tool (at least in VW2019). If you use the tool and rename a Resource Manager folder, the Resource Manager will reflect the change, but the tree control in the left pane of the Resource Manager will not, and you will be unable to open the folder or get to the resources inside it. So the tool will no longer be able to rename Resource Manager folders. Replace Name Text.vsm
  7. The issue with Sheet Layers is that the actual name of a sheet layer is the sheet number. The sheet title is an object variable called "layer description." It would take a bit of retooling to include them, but it's not impossible. I would also have to write in a bunch of exceptions since you can have more than one sheet layer with the same sheet title since it's not the universal resource name. What would probably be better would be to write an additional script to just handle sheet titles, which would be pretty simple as far as scripts go.
  8. The way I've done this is by testing object variable 1160 for screen plane. For hybrid symbols, the screen plane is what is used to differentiate between a 3D component and a 2D component (one of the reasons that removing the screen plane in 2022 made creating a hybrid symbol out of an already existing 3D symbol much more difficult). So I would go about doing this by using vs.FInGroup() on the symbol definition and stepping through with vs.NextObj() while doing a check with vs.GetObjectVariableBoolean([handle],1160). The kind of tricky thing is that you can't just use vs.DelObject() to delete the object right away, otherwise you can't use vs.NextObj() properly. So you instead have to copy the handle, use vs.NextObj(), then delete the object. My Python is a little rusty, but I just tested the following Vectorscript in 2022 and it worked well, even with Legacy 2D Features disabled. Searching for Screen Plane works best because then even traditionally 2D elements (such as text) can be removed from the 3D component of a hybrid symbol. PROCEDURE Delete3DTest; CONST kSymbolName = 'Test Symbol'; VAR h,h2:HANDLE; BEGIN h:=FInGroup(GetObject(kSymbolName)); WHILE(h<>NIL) DO BEGIN IF(GetObjectVariableBoolean(h,1160)=FALSE) THEN BEGIN h2:=h; h:=NextObj(h); DelObject(h2); END ELSE h:=NextObj(h); END; END; Run(Delete3DTest);
  9. Of course! I tried Layer.png and SheetLayer.png and several combinations of things with that, but didn't think to make it plural.
  10. @rebu1985 The reason the script no longer works is because the AddLBImage function was made obsolete in 2012. The new function is AddListBrowserImage which takes in a file path for the icon image rather than using an internal index. The advantage is that it allows you to use custom icons. The disadvantage is you now have to know the file path for the standard icon images, which does not appear in any appendix or function reference that I know of (but I would be very interested to see). You can get the script working by replacing lines 68-71 with: kImageCheck := AddListBrowserImage(dialog1,4,'Vectorworks/Standard Images/Checkmark.png'); kImageBlank := AddListBrowserImage(dialog1,4,'Vectorworks/Standard Images/Blank.png'); kImageSheet := AddListBrowserImage(dialog1,4,'Vectorworks/Standard Images/[Sheet Layer Icon Name]'); kImageView := AddListBrowserImage(dialog1,4,'Vectorworks/Standard Images/[Design Layer Icon Name]'); Unfortunately, I do not know the icon names for Design Layers or Sheet Layers, so you'll have to figure that out (unless someone here knows offhand). For now, you can comment out those lines and the rest of the script will run just fine. If someone has a Mac, the process for extracting icons is listed here under the heading Use icons from Vectorworks.app. Placing the name where I have the bracketed text will cause the correct icon to be loaded in with the layer name.
  11. Can you send me the Vectorworks file where it doesn't work? I need to know which array is not populating correctly to fix this bug. What exactly changed between the two images of it working and the two images of it not working? Moving the objects to a different layer? By workspace, I meant which VW product are you using? Fundamentals, Spotlight, Architect, Landmark, or Designer? When it fails, is your active layer a Design Layer or Sheet Layer? Are you in any kind of group/symbol/viewport edit window?
  12. @rebu1985 That's an odd message. Not the error that it's showing, but odd in that the line number doesn't make any sense and makes it hard to tell which part of the script is fouling up. The script is 1700 lines of code and uses a dozen or so different arrays to store and sort different pieces of data, so it's tricky to figure out which one is not working. What would help me a lot is to have more information. What exactly were you doing when the message popped up? Did it pop up immediately after running or was it after using the GUI? Does this happen with every drawing? If not, could you send me a copy of the drawing that it does happen on so I can see what's causing it? Also, any information about which version of Vectorworks you are running (year, workspace) would also be helpful.
  13. @Tom W. Well I'll be. I've been using Vectorworks since 2010 and somehow completely overlooked that feature though I've used the similar process for importing layers dozens of times. It makes me feel a wee bit foolish for spending a couple of hours writing up a redundant command.
  14. After working on this yesterday, I found myself doing a new drawing needing to copy over a bunch of classes from one drawing to another. In the past, I would do this by copying over any line styles, hatches, or textures and then drawing rectangles with each class. I would then copy these rectangles from the referenced drawing into the new drawing, effectively importing the classes. But with my newfound knowledge gained after yesterday, I wrote a menu command to simplify the process. Because there's not a Vectorscript command to open a file browser looking for VW files, I kludged something together using GetFolder instead. Basically, after selecting a folder, a List Box will be generated with all Vectorworks files in the folder, and selecting one will cause the File Path text field to be filled in. Pressing the Get Classes button will populate the List Browser with classes, which you can select to import. If the class already exists in the document, its name will be highlighted in blue, and it will be overwritten with the data from the imported class. If there's a naming conflict with something else in the drawing, the name will be highlighted in red and it will get an additional checkmark as a warning. If there is a naming conflict, the class will not be imported. Feel free to play around with it and let me know if anything breaks. Import Classes from File.vsm
  15. @MarcelP102 I have added code to allow for Roof Styles and Slab Styles to be placed in the Sub-Type column. I also made sure that the type called "Column, Floor, Roof Face" would not populate since they are not selectable as objects. Updated command attached. Let me know if anything else pops up. Filter Selection.vsm
×
×
  • Create New...