Ross McLee Posted March 30, 2021 Share Posted March 30, 2021 Hi again, Another feature request! Would it be possible to create viewports from a schematic layer by selecting the items you want to include in the viewport and click create viewport (I have a shortcut CTRL+SHIFT+V). This would be instead of having to create a rectangle and then using that as the crop border. It may require a degree of crop 'margin' )say one or two grid squares or may be a %age of the length/width to give some space around the objects being cropped nicely, and the viewport laying on the sheet layer centred 🙂 But this would speed things up nicely !! Thanks as always, R Quote Link to comment
Vectorworks, Inc Employee Conrad Preen Posted April 1, 2021 Vectorworks, Inc Employee Share Posted April 1, 2021 Sounds like a job for a scripter... Quote Link to comment
Popular Post Jesse Cogswell Posted April 2, 2021 Popular Post Share Posted April 2, 2021 @Ross McLee I wrote a script a while back to automatically generate hang cardboards for light plots and was able to adapt it for your requested purpose. The script is a menu command and requires that you have at least one object selected. When you run the command, a dialog box will open, prompting you to select a Sheet Layer to drop your viewport onto, as well as setting a "crop buffer" to pad out the viewport crop from your selected objects. This will be set to 1'0" the first time you run the tool, but will save whatever you have after clicking OK, so it will use that value next time you run the tool. This tool will work with any currently selected object, including object selection across multiple layers. It will create a viewport at the center of the page on the selected sheet layer with the same class and layer visibilities and at the active layer scale from when the command is run. Installation of plug-ins is a bit of a complicated process if you haven't done it before, so I have outlined the process below: Download the attached .zip file to an easy location (such as a Downloads folder or to the Desktop) Go to Tools - Plug-ins - Plug-in Manager Click on the "Third-party Plug-ins" tab Click on the "Install" button at the bottom left of the dialog Select the downloaded .zip file Restart Vectorworks (it should prompt you to do this) Once Vectorworks has restarted, open up your Workspace Settings by going to Tools - Workspaces - Edit Current Workspace Click on the Menus tab In the box on the left, find the "JNC" category and expand it. You should see an item called "Create VP from Selection" In the box on the right, find a menu you want to place the command in, such as View Drag the command from the left box to the desired location in the right box Assign a shortcut to the command (if desired) Click OK All done! Have fun with the tool Let me know if you have any trouble running or installing this. The tool was written in VW2019 but tested in VW2021 and should run in earlier versions if need be. If you run this with dimensions selected that are associated, you'll probably get a "Constraint not valid" alert. Not much I can do about that. Create VP from Selection.zip 8 Quote Link to comment
Ross McLee Posted April 6, 2021 Author Share Posted April 6, 2021 I'll look into this today - Thank you @Jesse Cogswell Quote Link to comment
Ross McLee Posted April 27, 2021 Author Share Posted April 27, 2021 @Jesse Cogswell. Thank you so much for this script - it works a treat. Only feedback I have is that the viewport is placed away from the sheet layer (page) origin. if the x/y could default to 0,0 that would be great. But otherwise, this has saved me so much time. ( have done lots of viewports i bulk, and just gone into the navigator and set the x/y coords for all the viewports to 0, in one go (a great feature of VW!) Quote Link to comment
Jesse Cogswell Posted April 27, 2021 Share Posted April 27, 2021 @Ross McLee Hmmm. The script should center the viewport for you. When viewports are created, they are created in relation to the existing page center on the design layer. I'll look back at this script when I get some time, maybe I don't have it read in the existing page location. It certainly centered the viewports in my testing. Ah, just tried playing around with it. It gets screwed up if your User Origin is different than the Internal Origin. If you run Tools-Origin-User Origin and select Set User Origin to Internal Origin, this should correct this. This is a big pain point I have with Vectorworks, as the Internal Origin is poorly explained but is what the GetOrigin VS command references. A lot of draftspeople start a drawing without regard to the Internal Origin, then set a User Origin later. There is no direct coding in VS to get the User Origin, you instead have to use a GetPrefReal(6702) and GetPrefReal(6703) and convert the units. So, if I'm feeling lazy and writing scripts for free, I tend not to put that scripting in. After I started scripting, every single one of my drawings is very cognizant of where the Internal Origin lands, usually on CL-PL intersection. When I get a moment, I'll add in the scripting to compensate for the User Origin, but that will probably be in a couple of days. Quote Link to comment
Thomas K. Posted June 24, 2023 Share Posted June 24, 2023 hi just stumbled in here as I am facing a similar question/task. I have an imported ifc-file with about 800 ifc-space objects. these should each be placed as a separate viewport on a layout layer with matching scale. these should be named to match the room number. the selection of the rooms should run via attached database with an entry as criterion. the sheet format, the database and the entry of the criterion should be disbursable in a dialog. has there ever been something like this or is my thinking too far away. looking forward to input and feedback Quote Link to comment
Pat Stanford Posted June 25, 2023 Share Posted June 25, 2023 This sounds like to could be scriptable. But you are probably looking at 5-15 hours of programming time to get it right. Questions: 1. You need to do this in VW2017? 2. How are the IFC-space objects distributed? Are they all next to each other or are they spread out? 3. Are the IFC objects all rectangular or are they interlocked like puzzle pieces? This will make a big difference in making crop objects. Especially if you don't want any overlap of other spaces in the viewport. I just looked at the function reference, and there does not appear to be an easy way to get the object associated with a worksheet database subrow. So is there a column in the database that is unique for each object? You will have to get that value from the database and then find the object that has that same value. I have no idea what you mean by "the sheet format, the database and the entry of the criterion should be disbursable in a dialog." Do you have any funds to pay for this or are you hoping for a freebie? Quote Link to comment
Thomas K. Posted June 26, 2023 Share Posted June 26, 2023 @Pat Stanford i am more than happy having you monitoring all parts of the forum 😉 i came up with this task because i found this post. 1. absolutely not. vw2023. 2. It looks like a normal office building with 6 stories. 3. both. puzzle and nice and clean. there is no need the border fits the exact layout of the room. a rectangle would do the job. i will not need all rooms. only the ones that contain av tec. that is marked out via my own database with a popup that says: "---" or "yes". 12 hours ago, Pat Stanford said: have no idea what you mean by "the sheet format, the database and the entry of the criterion should be disbursable in a dialog. what i wanted to say is: it would be nice to have a dialog windows where these parameters could be entered before the command is executed. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.