Jump to content

Updating Drawing Labels in Viewports


Recommended Posts

So in trying to familiarize myself with the new Drawing Label and how it functions I cannot seem to understand how to get the Drawing Label to update to reflect changes to the sheet number and drawing title. And I have just realized that viewports do not automatically update their name when the sheet number is changed. I never really paid much attention to viewport naming before because it was just a manual duplication of work for no visible outcome.

When I change the drawing title of the viewport in the object info window the Drawing label doesn't refresh to show the new name.

When I manually change the sheet number in the viewport name field (because viewports don't seem to be updated when a sheet number is changed in the sheet layers dialog) that change is also not transferred to the new Drawing label.

Am I banging my head against the wall in thinking this should be occurring?

Is there any documentation issued that I have simply missed that illustrates how to set up and use the functionality of this new label?

 

Thanks.

Link to comment
3 hours ago, LarryO said:

When I change the drawing title of the viewport in the object info window the Drawing label doesn't refresh to show the new name.

Make sure you have "use automatic drawing configuration" checked in the File>Document Preferences>Display dialogue.

 

Just to clarify, "drawing title" and "viewport name" are two entirely separate things. The drawing label should update automatically to show the drawing title. The drawing label is not connected to the Viewport name which is at the bottom of the OIP window and, unless you use a script is only edited manually.

 

Nothing is new with this. This functionality is just the same as with the previous drawing label.

 

  • Like 1
Link to comment

Well that was an improvement. It's still a hit and miss on whether the viewport names reflect the drawing number and sheet number. The latter only seems to occur during viewport creation and the drawing number only updates when the sheet number is already correct, but it occurs after deselection of the viewport.

Link to comment

I had a quick look at your file.

 

On 5/26/2021 at 9:51 AM, LarryO said:

I have just realized that viewports do not automatically update their name when the sheet number is changed.

As mentioned, vp's don't auto update to changes in sheet number or drawing tile or vica versa. If you meant the Drawing Label doesn't update then I don''t seen this behavior in your file. The sheet number in the drawing label doesn't seem to change but as soon as you zoom or pan the label updates.

 

On 5/26/2021 at 9:51 AM, LarryO said:

When I change the drawing title of the viewport in the object info window the Drawing label doesn't refresh to show the new name.

I don't understand this.

Your Drawing Label "Accord Primary" doesn't call up the drawing title.

Your Labels "Accord w back ref" & "Accord Secondary " updates ok when the vp is selected and the drawing title or number are

changed in the OIP. Are you seeing different? See attached screen recording.

 

On 5/26/2021 at 9:51 AM, LarryO said:

When I manually change the sheet number in the viewport name field (because viewports don't seem to be updated when a sheet number is changed in the sheet layers dialog) that change is also not transferred to the new Drawing label.

Yes, vp names and drawing labels are not linked.

 

10 hours ago, LarryO said:

the drawing number only updates when the sheet number is already correct, but it occurs after deselection of the viewport.

Can you explain this more?

 

From your PM: "When you go to page 03 having section A-A on it your will notice that the anticipated back reference to page HB01 has not filled in either."

You need to select which markers you want as back references. Select the vp and click on "Select back references". Best to choose "select objects from list" then put a check mark next to the marker/s you want to back ref..

 

image.thumb.png.c45f2cdea5c20761465d890e84933b2f.png

 

If you want to keep your vp names to match the sheet number, drawing number & drawing title then @michaelk has developed a really good script which will name selected viewports. Posted below. Be aware that with v2021 it's probably best to just use this on top/plan viewports. You can see how it works in the screen recording. I use it so much I have put it as a menu command.

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);




 

 

 

Link to comment
2 hours ago, Boh said:
On 5/25/2021 at 2:51 PM, LarryO said:

When I change the drawing title of the viewport in the object info window the Drawing label doesn't refresh to show the new name.

I don't understand this.

Your Drawing Label "Accord Primary" doesn't call up the drawing title.

Your Labels "Accord w back ref" & "Accord Secondary " updates ok when the vp is selected and the drawing title or number are

changed in the OIP. Are you seeing different? See attached screen recording.

 

That part was the improvement, it started functioning after checking the "use automatic drawing configuration setting" you mentioned.

Link to comment
2 hours ago, Boh said:
12 hours ago, LarryO said:

the drawing number only updates when the sheet number is already correct, but it occurs after deselection of the viewport.

Can you explain this more?

The viewport name when created and the selection to use drawing number/sheet number is selected names the viewport in the manner expected

example: 1/HB02

Now if I want to change that drawing number assigned to the viewport, I select the viewport and in the object info palette change the drawing number to 5 or C or whatever, then the prefix of the viewport's name will also change once you allow the OI palette to refresh but only under one condition. The suffix of the name must still match the sheet name. If one changes the sheet name beforehand, as we have observed, the suffix of any viewport names on that sheet will not adjust to reflect the new sheet name and the process of updating drawing numbers to the viewport name will cease to function too.

Link to comment
5 minutes ago, LarryO said:

Now if I want to change that drawing number assigned to the viewport, I select the viewport and in the object info palette change the drawing number to 5 or C or whatever, then the prefix of the viewport's name will also change once you allow the OI palette to refresh but only under one condition. The suffix of the name must still match the sheet name.

Ok, I didn't know the default vp name could update like this. Not sure how useful it is if only the drawing number that updates and only if the sheet number hasn't changed. For software that boasts of 3d bim and auto coorodination etc this is a real failing. Viewport naming is essential for 3d work esp on larger projects and haveing to do it manually is just not really good enough.

 

I recommend using the script posted earlier. It may also work on section viewports but doesn't work on detail viewports.

 

 

  • Like 1
Link to comment
2 hours ago, Boh said:

From your PM: "When you go to page 03 having section A-A on it your will notice that the anticipated back reference to page HB01 has not filled in either."

You need to select which markers you want as back references. Select the vp and click on "Select back references". Best to choose "select objects from list" then put a check mark next to the marker/s you want to back ref..

The list was not populated with anything when I opened it, but I think I may have observed from your photo why that was so.

I think that I may have been in the annotation space with the drawing label selected rather than selecting it's parent viewport.

I was attempting to get HB02 show in the bottom half of the drawing tag of the section viewport on page 03.

I'll have to look at this one again when I'm back at the shop.

  • Like 1
Link to comment

@Boh I think you have an old version of that script.  I'll have to see if I can find a newer one.  (I'm pretty casual when it comes to script version control.  I often don't have the most current version of my own scripts in my menu commands. 🙂 )

 

You can safely use that script on any sheet layer viewport except Section Viewports.  It will semi break the link back to the section line.  @Matt Panzer was kind enough to submit it as a VW bug, rather than a me bug.  I still use it on Section Viewports and just deal with the consequences, if any.  

Link to comment
57 minutes ago, LarryO said:

The list was not populated with anything when I opened it, but I think I may have observed from your photo why that was so.

Yes the list will be unpopoulated by default with "None" in the "Back references" drop down. You need to select an option other than none.

 

29 minutes ago, michaelk said:

@Boh I think you have an old version of that script.  I'll have to see if I can find a newer one.  (I'm pretty casual when it comes to script version control.  I often don't have the most current version of my own scripts in my menu commands. 🙂 )

 

You can safely use that script on any sheet layer viewport except Section Viewports.  It will semi break the link back to the section line.  @Matt Panzer was kind enough to submit it as a VW bug, rather than a me bug.  I still use it on Section Viewports and just deal with the consequences, if any.  

That would be great Michael. I thought I had updated it a while back when we were posting about this on another string. Maybe that's why it's not working on detail viewports!

 

Cheers

Link to comment
  • 5 months later...

You just need to change part of one line :-).

 

I'll attach a file with the script and the text of the script here:

 

 

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, 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))));

End;

Run(ViewportRename);

 

RenameAllVP.vwx

  • Like 1
Link to comment

Awesome, what line?

 

I already made two versions of the script to shorten the names. I'm a noob on that end of things, but it was fun to figure out. 

 

I also found that if I have just one viewport selected it will rename all of them if they need to be updated for other reasons. 

Edited by trashcan
Link to comment

The file and script I posted above changes the line

 

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

 

to 

 

ForEachObject(RenameVP,(((T=VIEWPORT))));

 

 

The first one means "find every object that is a viewport and is selected and run the procedure named RenameVP on it"

 

The second one means "find every object that is a viewport and run the procedure named RenameVP on it"

 

The reason it sort of worked on other viewports for you is probably because I should have used a different criteria and specified that it should only run on VISIBLE selected viewports.  I know now that it's possible and actually probably that there are selected objects that are on layers not currently visible.  But that was many years ago and my scripting skills were even worse then than they are now :-).  

 

Luckily, you don't have to be really good at it to make really useful scripts.

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