Ben3B Posted November 14, 2024 Share Posted November 14, 2024 (edited) Hello, everything is in the title :) Who have an Idea ? Here is the topic from where that idea come : https://forum.vectorworks.net/index.php?/topic/121044-automatic-name-of-the-view-in-the-viewport-name-in-the-title-block/ thanks! Edited November 14, 2024 by Ben3B Quote Link to comment
michaelk Posted November 14, 2024 Share Posted November 14, 2024 This script works on everything except for Left Isometric. I have no idea why. Maybe someone else can fix it. viewport views.vwx Quote Link to comment
MullinRJ Posted November 15, 2024 Share Posted November 15, 2024 Try: IF (rotationXAng = -45) AND (rotationYAng = Iso) AND (rotationZAng = 30) THEN ViewTitle := 'Left Isometric'; One too many minus signs. 😉 Raymond Quote Link to comment
Pat Stanford Posted November 15, 2024 Share Posted November 15, 2024 You beat me by 10 minutes Raymond. 😞 Quote Link to comment
MullinRJ Posted November 15, 2024 Share Posted November 15, 2024 A short lived victory. 🥳 You are the standard to which we all must compete. I shall celebrate swiftly then return to my keyboard. Keep the bar high. I'm counting on you. 😉 Raymond Quote Link to comment
Pat Stanford Posted November 15, 2024 Share Posted November 15, 2024 Turbulence on takeoff out of DTW so I couldn't get my computer right away. 😉 Until next time. 🤺 Quote Link to comment
MullinRJ Posted November 15, 2024 Share Posted November 15, 2024 I'll take it 🙂 Quote Link to comment
michaelk Posted November 15, 2024 Share Posted November 15, 2024 With thanks to Raymond and Pat! Select a viewport and run the script. This is just a test to see if it was possible. (And to learn how it works) I assumed you would want to add to a title that was already there. Let us know how you would like it formatted. It would probably be a good idea to be able to select and rename more than one viewport at a time also :-). It was interesting to figure out how viewports set their views. I've never had to learn about the viewmatrix before. viewport views.vwx Quote Link to comment
Ben3B Posted November 15, 2024 Author Share Posted November 15, 2024 (edited) Thank you so much , it works well!!! attached is the file with the same script with french view name viewport views US_FR.vwx Do you know if its possible to do the same with datatag? by the way I could insert it in the title block style , to automate it ;) and YES below is a good idea :) 7 hours ago, michaelk said: It would probably be a good idea to be able to select and rename more than one viewport at a time also :-). Edited November 15, 2024 by Ben3B Quote Link to comment
michaelk Posted November 15, 2024 Share Posted November 15, 2024 Here's the same script that will allow you to select multiple viewports. Data tags would be more complicated. I'll have to think about that one. Pat or Raymond may have a thought in the mean time. viewport views US_FR_Mult.vwx Quote Link to comment
Ben3B Posted November 15, 2024 Author Share Posted November 15, 2024 (edited) I've found a problem with the script if the first viewport isn't at top plan it name it top plan as you can see below I did with french and us version ;) I started from 1 duplicate to 2 and 2 to 3 (change the view) and the duplicate the 3 first 1-2-3 to 4-5-6 change to wireframe the duplicated 5 to 7 change to top plan and then duplicated 1-2-3-4-5-6-7 to 8-9-10-11-12-13-14 I mean that's why 1-4-8and 11 are wrong because there all are from 1 ;) pb viwport rename.vwx Edited November 15, 2024 by Ben3B Quote Link to comment
Ben3B Posted November 15, 2024 Author Share Posted November 15, 2024 (edited) Erratum : I think that just after copy the 1 to 2 I put the n°2 on top plan and finally change to top and then did what I wrote above ... So if the first viewport isn't top plan, as soon as you pass by the top plan view in the sheet layer , the script will be ok pb with script rename.mp4 Edited November 15, 2024 by Ben3B Quote Link to comment
Pat Stanford Posted November 15, 2024 Share Posted November 15, 2024 Data tags can use worksheet scripts. So a minimal modification to the first script as long as you are using the Data Tag to tag the viewport. Replace the FSActLayer at the top with WSScript_GetObject Replace the SetObjectVariableString at the bottom with WS_Script_SetResStr Then assuming the script is named Script in the data tag use: #WS_RunScript('Script')# 1 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.