Jump to content
Developer Wiki and Function Reference Links ×

vectorscript to read the viewport view and write that data to the viewport title


Ben3B

Recommended Posts

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

Link to comment

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 by Ben3B
Link to comment

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
image.thumb.png.e3549af5fa07c9ee9aa0a0ab691cba18.png

Edited by Ben3B
Link to comment

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')#

  • Like 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...