Jump to content
  • 5

Renaming Viewports - Is this really not possible from the Navigation Palette?


Kevin McAllister

Question

Is it really not possible to rename a SLVP from the Viewports tab of the Navigation Palette? I right click and choose edit but there's no field for the name of the viewport. I can edit the name of the drawing associated with the viewport. It seems like the only way to rename a SLVP is to select the viewport individually and rename it in the OIP. Am I missing something?

 

Kevin

  • Like 3
Link to comment

Recommended Posts

  • 0

I don't think it is possible.  

 

There was a thread about scripting this a while ago.  I stole the idea from somebody (maybe it was you?).

 

I thought I had posted it in the old forum, but I don't see it there.

 

This script will take selected SLVP(s) and change the name to Sheet # [space] Drawing # [space] Drawing Title

 

It works ok in 2016 and so far it works in 2017.

 

Not the same as being able to rename right from the nav palette, but I find it keeps my naming convention more unified and makes it easier to figure out what viewport is what in the visibilities view of the Organization dialog box.

 

hth

 

mk

 

Procedure ViewportRename;

{Badly Scripted by Michael Klaers.  Updated Aug 2, 2015}

{This script will take all selected viewports and change the name of those viewports to be

        (Sheet Layer) (Drawing Number) (Drawing Name)

This version tries to force the name to appear immeidately in the name field, data tab, OIP when only one VP is selected.

Prior to this version the new name appeared immediately in the Nav Palette, but not in the name field.}


    Var
    VPDwgTitle,VPName,BText,VPNum : String;    
    h,hh:  Handle;
    ViewportLayer: Handle;
    ViewportLayerString: String;

    
    


    Procedure RenameVP(h : HANDLE);
Begin                            {***********  BEGIN Procedure  ***********}    
    ViewportLayer:= GetLayer(h);
    ViewportLayerString:= GetLName(ViewportLayer);
    VPDwgTitle := GetObjectVariableString(h, 1032);
    VPNum := GetObjectVariableString(h, 1033);
    ResetObject(h);

    SetName(h, CONCAT(ViewportLayerString,' ',VPNum,' ',VPDwgTitle));

    SetDSelect(h);        {These two commands are just here to force the new name to appear in the }
    SetSelect(h);        {name field immediately.  They can be deleted w/o consequence}

End;                            {***********  END Procedure  ***********}

 

Begin                            {***********  Main Program  ***********}    

    ForEachObject(RenameVP,(((T=VIEWPORT) & (SEL=TRUE))));

End;

Run(ViewportRename);

 

 

  • Like 3
  • Love 1
Link to comment
  • 0
On 9/27/2016 at 8:23 PM, JimW said:

Looks like an oversight, in 2016 under "Edit" you could rename it in the Data field, but we moved the Name to a constantly visible field in 2017 and the Nav palette Edit UI wasn't updated to include that.

 

Submitting as a bug now.  

VB-136963

Hello and thanks for response on last query, i'm confused on this as well. If i use a the built in drawing title symbol then it takes the [Drawing Title] field in the viewport OIP. However this only works if i name viewport then add title. If i duplicate a sheet and then rename the viewport the drawing title symbol does not update , is the field not a live link? 

Link to comment
  • 0
On 9/28/2016 at 8:37 AM, michaelk said:

I don't think it is possible.  

 

There was a thread about scripting this a while ago.  I stole the idea from somebody (maybe it was you?).

 

I thought I had posted it in the old forum, but I don't see it there.

 

This script will take selected SLVP(s) and change the name to Sheet # [space] Drawing # [space] Drawing Title

 

It works ok in 2016 and so far it works in 2017.

 

Not the same as being able to rename right from the nav palette, but I find it keeps my naming convention more unified and makes it easier to figure out what viewport is what in the visibilities view of the Organization dialog box.

 

hth

 

mk

 

Procedure ViewportRename;

{Badly Scripted by Michael Klaers.  Updated Aug 2, 2015}

{This script will take all selected viewports and change the name of those viewports to be

        (Sheet Layer) (Drawing Number) (Drawing Name)

This version tries to force the name to appear immeidately in the name field, data tab, OIP when only one VP is selected.

Prior to this version the new name appeared immediately in the Nav Palette, but not in the name field.}


    Var
    VPDwgTitle,VPName,BText,VPNum : String;    
    h,hh:  Handle;
    ViewportLayer: Handle;
    ViewportLayerString: String;

    
    


    Procedure RenameVP(h : HANDLE);
Begin                            {***********  BEGIN Procedure  ***********}    
    ViewportLayer:= GetLayer(h);
    ViewportLayerString:= GetLName(ViewportLayer);
    VPDwgTitle := GetObjectVariableString(h, 1032);
    VPNum := GetObjectVariableString(h, 1033);
    ResetObject(h);

    SetName(h, CONCAT(ViewportLayerString,' ',VPNum,' ',VPDwgTitle));

    SetDSelect(h);        {These two commands are just here to force the new name to appear in the }
    SetSelect(h);        {name field immediately.  They can be deleted w/o consequence}

End;                            {***********  END Procedure  ***********}

 

Begin                            {***********  Main Program  ***********}    

    ForEachObject(RenameVP,(((T=VIEWPORT) & (SEL=TRUE))));

End;

Run(ViewportRename);

 

 

I just got onto VW2017 & straight away saw that I couldn't rename sheet layer viewports so this script is a lifesaver! Is it possible to create a similar script that renames design layer viewports? It would be very helpful as I also use these extensively. Thanks for any help.

  • Love 1
Link to comment
  • 0

You can rename DLVPs.  Just not in the Nav Palette.  (That's on the list to be fixed)  Select the DLVP and in 2017 the name will be at the bottom of the OIP.  You can edit it there.

 

What would you want the script to do?  There are no drawing numbers or drawing names associated with DLVPs.  If this script were modified to work with DLVPs where would it pull the name from?  Or would it just pop up a dialog box and let you type the name in?  (Which doesn't seem that different from doing it in the OIP)

 

mk

 

Link to comment
  • 0

Thanks Michaelk!

 

I couldn't find it the DLVP name for the life of me until I realised I had my attribute palette at the bottom of my OIP - right on top of where the name is....  I see the SLVP names are there too.

 

No need for DLVP naming script. The SLVP naming script is fantiastic tho.

Cheers

Link to comment
  • 0

Resource manager.

 

Copy the script.  

In the resource manager set the pull down for scripts.

Click New Script at the bottom of the Resource Manager.

It will ask for the name of a palette, which is really just a folder.  Name it.

it will next ask for the name of a script.  Name it.

A Script Editor window will appear.  Make sure the Language is set to VectorScript.

Paste the script into the window.

Click OK.

 

The script is now a resource like any other Vectorworks resource.

If you right click on the "folder" (Called a script palette in the Resource Manager) and choose Open a new palette will appear on your screen with your new script listed in it.  You can run the script by double clicking on the script in that palette. Or you can right click on the script in the Resource Manager and choose Run.

 

Let us know if you get stuck.

 

hth

mk

  • Like 1
Link to comment
  • 0

The viewport name is what VW calls the viewport.  It's the name that appears in the Navigation Palette.  If you don't give the viewport a name they appear as Viewport-1, Viewport-2, etc.

 

The drawing title is what appears on the drawing in the drawing label tool.  

 

Viewport name is what VW sees.  Drawing title is what the world sees.

 

 

Link to comment
  • 0

@Andrew Daviesadding to @michaelk... 

 

It's really an organizational vs. presentation distinction.

 

I typically abbreviate viewport names to organize my drawing in a nerdy systematic hierarchy (similar to classes) for quick sorting and searching:

  • Plan Overview
  • Iso Left
  • Iso Left Persp HL
  • Iso Left Persp GL
  • Front Stage

 

However, I prefer to title drawings with natural language to improve readability for clients and collaborators:

  • Overview
  • Left Iso
  • Left Perspective
  • Left Perspective Render
  • Stage Elevation
  • Like 2
Link to comment
  • 0

I use a script to force my viewport names to be [Sheet #] [Drawing Number] [Drawing Name]

 

So it ends up being something like A2 2 Proposed Site Plan

 

That way when I'm looking at the visibility view in the navigation palette to double check what classes are visible in what viewport, all my viewports are in the order in which they appear in the drawing with the drawing label names.

 

… and then I only have to type the name once. :-)

 

  • Like 1
Link to comment
  • 0

Speaking of that script:  @Pat Stanfordhelped me fix a possible situation that could throw up an error message.

 

With thanks to Mr. Stanford, here's the updated script:

 

Procedure ViewportRename;

{Badly Scripted by Michael Klaers.  Updated Aug 2, 2015}

{This script will take all selected viewports and change the name of those viewports to be

		(Sheet Layer) (Drawing Number) (Drawing Name)

This version tries to force the name to appear immeidately in the name field, data tab, OIP when only one VP is selected.

Prior to this version the new name appeared immediately in the Nav Palette, but not in the name field.}


	Var
	VPDwgTitle,VPName,BText,VPNum : String;	
	h,hh:  Handle;
	ViewportLayer: Handle;
	ViewportLayerString: String;

	
	


	Procedure RenameVP(h : HANDLE);
Begin							{***********  BEGIN Procedure  ***********}	
	ViewportLayer:= GetLayer(h);
	ViewportLayerString:= GetLName(ViewportLayer);
	VPDwgTitle := GetObjectVariableString(h, 1032);
	VPNum := GetObjectVariableString(h, 1033);
	ResetObject(h);


{	Message('Viewport Handle: ',h,chr(13), 
			'Layer Handle: ',ViewportLayer,chr(13),
			'Layer Name: ',ViewportLayerString,chr(13),
			'VP Num: ',VPNum,chr(13),
			'VP Name: ',VPDwgTitle);
}

	SetName(h, Date(2,2));
	SetName(h, CONCAT(ViewportLayerString,' ',VPNum,' ',VPDwgTitle));

	SetDSelect(h);		{These two commands are just here to force the new name to appear in the }
	SetSelect(h);		{name field immediately.  They can be deleted w/o consequence}

End;							{***********  END Procedure  ***********}



Begin							{***********  Main Program  ***********}	

	ForEachObject(RenameVP,(((T=VIEWPORT) & (SEL=TRUE))));

End;

Run(ViewportRename);




 

  • Like 2
  • Love 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
Answer this question...

×   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...