Jump to content
  • 13

Data Visualisation legend: option to not create


Tom W.

Question

7 answers to this question

Recommended Posts

  • 0
3 minutes ago, fuberator said:

possibly stating the obvious: With the viewport(s) selected: choose "none" in the data visualisation popup in the OIP and it disappears

 

Doing that gets rid of the Data Viz completely. It's just the legend I want to get rid of not the Data Viz itself

Link to comment
  • 0

Here is the script to remove legends from all viewports. 

##This script remove data visualization legend from all view ports on all sheet layers
## Created by Jiajing Qi, Tested: VWX2023 SP1, 01/03/2023
## Use it on your own risk

import vs;
global i
i = 0

vs.Message("This script removed data visualization legend from all view ports on all sheet layers.")
# collect handles of selected VPs on active layer
def GetHandle(h):
	if vs.GetObjectVariableInt(vs.GetLayer(h), 154) == 2:
		if vs.GetTypeN(h) == 122:
			hVP.append(h)

hVP = []
vs.ForEachObjectInLayer(GetHandle, 0, 2, 1)

# Traverse into the annotations group of selected VPs and delete Data Visualization Legend
for VP in hVP:
	anno = vs.GetVPGroup(VP, 2)
	h = vs.FInGroup(anno)
	objs = [h]
	h = vs.NextObj(h)
	while h != vs.Handle(0):
		if vs.GetObjectVariableString(h, 1166) == "Data Visualization Legend":
			vs.DelObject(h)
			vs.UpdateVP(h)
			i = i + 1
		h = vs.NextObj(h)
if i > 1:
	vs.AlrtDialog(f"Removed {i} data visualization legends")
else:
	vs.AlrtDialog(f"Removed {i} data visualization legend")

 

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