Jump to content

Controlling visibility using data visualisation


Recommended Posts

9 hours ago, line-weight said:

 

I think that having saved views set up could potentially work, if those visibility settings could flow through to a sheet layer viewport, although I don't really see how that could happen. A downside of this approach is (I think)that I'd have to re-perform the custom selection process, and redefine the relevant saved views, each time I added a new object to the model.

 

 

Yes that's a good idea, a way to get around the limited filtering abilities of DV. I think this could work well, as long as the method of setting line/fill to none doesn't have any unexpected side effects.

Never mind. My idea of using Custom Visibility does not appear to work. The objects hidden on the design layer show in the viewport.

 

So we are back to using Data Visualization. 😞

 

So again, do you have a limited set of dates that you need? Or is this a dynamic situation where you could need to generate any date at any time?

 

Link to comment

One more try.

 

Take a look at the attached file. VW2020.

 

Run the script named Set Year Boolean. Try a value of 1955.  You should be able to update the top right viewport and see all of the "buildings/chairs/etc"

 

Run the script again and set a year of 1991. You should get a view showing a reduced set of objects.

 

Some of the objects have a Record ('PTS') attached. The script goes through and sets a boolean field based on buildings that have a built date of before the year you set in the dialog and a demoed date after the year you set in the dialog.

 

The visualization then sets the Fill and Pen on objects that do not have a TRUE value in the record to None.

 

The script could be modified in a number of ways to allow for multiple options.  Perhaps easiest would be to set a field for each year (or a subset of desired years) and populate that field appropriately.

 

When you modify dates or add buildings you would have to rerun the script, but it should not effect the visualization in any other way.

 

Dual Data Visualization.vwx

Link to comment

Just throwing in another idea...

Is there a workable option to draw all the buildings with no fill or line I.e effectively invisible, but then use dv to add fill and lines to make them visible?

 

(This is the inverse of using DV to make things invisible).

 

Edit: You couldn’t model the  Bldgs in that file but possibly drawn in another file and as symbols referenced into master file where the classes are changed.

 

Thus probably isn’t a realistic solution but still interesting.

Edited by Boh
Link to comment
On 10/4/2019 at 7:50 PM, Pat Stanford said:

OK Here is a version very lightly tested in VW2018 SP3.  OpenGL rendering does not seem to work properly, but wireframe, hidden line, and Renderworks do.

 

Dual Data Visualization v2018.vwx

Thanks again for taking the time to do this.

 

I've looked at the file. Changing the date using your script doesn't change the object visibilities in that viewport, I'm not sure why*

 

I think I understand the logic though: the script looks at the build and demo date for each object and then sets the other record to 'true' or 'false' according to the requested date.

 

Then the viewport DV uses that value to decide whether or not to display the object.

 

This means it wouldn't work if I wanted several viewports, each showing the state of existence at a different date. But I think you are suggesting that this could be dealt with by having a 'true/false' field for each desired year. So the record could have a bunch of true/false fields called "exists in 1955", "exists in 1970", "exists in 1991" etc. And the script would populate some/all/none of those fields as necessary.

 

* When I look at the viewport DV settings in your file, for the 'Data Visualisation-4' viewport, I notice:

- 'Enable Data Visualisation for This Viewport' is not ticked (I think it should be?)

- It's set to 'Record Field': Build (I think it should be set to Record Field: Year)

- Under Record Field: Year, in the values list, 'False' is set to show with pen/line thickness (I think it should be set to fill=none and pen=none)

 

Having changed the above, it still didn't work.

 

The script does seem to tick/untick the true/false box correctly (when I look at the objects on the design layer), but somehow the DV is not doing what it should.

 

Link to comment
On 10/4/2019 at 8:11 PM, Boh said:

Just throwing in another idea...

Is there a workable option to draw all the buildings with no fill or line I.e effectively invisible, but then use dv to add fill and lines to make them visible?

 

(This is the inverse of using DV to make things invisible).

 

Edit: You couldn’t model the  Bldgs in that file but possibly drawn in another file and as symbols referenced into master file where the classes are changed.

 

Thus probably isn’t a realistic solution but still interesting.

 

Yes, I think the problem with this would be that you couldn't work on the model in the design layer because everything would be invisible.

 

This raises a problem with other solutions using record formats though, including the one with @Pat Stanford's script above: in the model, some 'sites' will have more than one building on them - they'll have eg the building that existed from 1870 to 1955, and the building that existed from 1960 to 1991 on them. So if you are looking at the model with 'everything on' then they are both going to be there, drawn on top of each other. If they are in different classes that's fine because you can just turn off the classes as appropriate whilst looking at the design layer. In VW2018, I don't think there is a way of making things invisible in the design layer bases on their record format data, but perhaps the changes to DV in VW2020 mean that there now is?

Link to comment
4 hours ago, line-weight said:

Thanks again for taking the time to do this.

 

I've looked at the file. Changing the date using your script doesn't change the object visibilities in that viewport, I'm not sure why*

 

I think I understand the logic though: the script looks at the build and demo date for each object and then sets the other record to 'true' or 'false' according to the requested date.

 

Then the viewport DV uses that value to decide whether or not to display the object.

 

This means it wouldn't work if I wanted several viewports, each showing the state of existence at a different date. But I think you are suggesting that this could be dealt with by having a 'true/false' field for each desired year. So the record could have a bunch of true/false fields called "exists in 1955", "exists in 1970", "exists in 1991" etc. And the script would populate some/all/none of those fields as necessary.

 

* When I look at the viewport DV settings in your file, for the 'Data Visualisation-4' viewport, I notice:

- 'Enable Data Visualisation for This Viewport' is not ticked (I think it should be?)

- It's set to 'Record Field': Build (I think it should be set to Record Field: Year)

- Under Record Field: Year, in the values list, 'False' is set to show with pen/line thickness (I think it should be set to fill=none and pen=none)

 

Having changed the above, it still didn't work.

 

The script does seem to tick/untick the true/false box correctly (when I look at the objects on the design layer), but somehow the DV is not doing what it should.

 

I have it working here in both 2020 and 2018. Visualization in 2020 has been greatly enhanced, so if you really need to do this, you should at least consider upgrading.

 

There is a very limited set of dates, so only a few dates will show a difference. I know everything will be visible in 1955, nothing will be visible before 1900 or after 2000, and at least some items will be invisible in 1991.

 

You are correct. If you need multiple dates we can either modify the script to give you boolean fields for those dates or give you multiple scripts that store the data into different fields that can be used on different viewports.

 

You are correct that the Enable should be on and the Record Field should be Year.  For False the pen and fill should be None. I don't know why it is not working for you. Unless you are using OpenGL where it did not seen to hide objects properly.

 

image.thumb.png.dd07ebb27ef08381078430a218f59eea.png

Year 1991

image.thumb.png.5edcd3b660c872e2d7c7f20c230129b7.png

Year 1955

image.thumb.png.1e1cf3bb37579eaad7c713ad3c88c1aa.png

Link to comment

Ok, yes I had it set on OpenGL.

 

Switching to wireframe sort of fixes it, but it seems i have to switch wireframe->openGL->wireframe to get it to update properly, so there's obviously something buggy going on.

 

When I do a 'fast external' renderworks style I get the black holes like your image above.

Link to comment
  • 2 years later...
On 9/30/2019 at 5:20 PM, line-weight said:

Before I get to the question let me explain the particular situation I am looking at. Also - I am currently on VW2018.

 

I am building a model which shows buildings on several streets. This will eventually become a model that shows the development of the area over time. I want to create views of the model that show snapshots in time, over a historical period. So for example, I have three buildings:

Building A is built in 1870 and demolished in 1950.

Building B is built in 1910 and demolished in 1960.

Building C is built in 1951 and still exists.

So in my "existing in 1900" view, buildings A and B should be visible.

In my "existing in 1955" view, buildings B and C should be visible.

In my "as currently exists" view, only building C should be visible.

 

I started out thinking that I would do this using classes (eg building A would be in an "1870-1950" class), with certain classes being switched on and off in each view. This I think is possible, but will create a large list of classes that I'll have to manually choose from for each view.

 

Then I started wondering if this can be done using data visualisation. I give each building a "built date" and "demolished date". Then, if I want to see an "exists in 1955" view I use the data vis controls on a viewport to make invisible anything with a "built date" higher than 1955, and anything with a "demolished date" lower than 1955.

 

Having fiddled around a bit with the data visualisation settings (which I've not really used before), I am not sure that I can do what I want. So, my questions:

 

1) Is it right that I can't simply set objects with specific data attached to them to be "visible" or "invisible"? I have to set those objects with a 'none' fill and pen to make them invisible?

 

2) Is it right that I can't apply rules relating to more than one record field to each viewport? So I can't say, make it invisible if "built date">1955 OR "demolish date"<1955?

 

3) Have either of the above changed in VW2020?

 

 

 

Ok... so I wrote the above post in 2019 when I was still on VW2018. I'm now using VW2021 ... and I think the answer to questions 1 & 2 is that these things are now possible.

 

So, have been messing around with a new file, and making a record format that contains date fields. However... it looks like I can't have any dates earlier than 1904, which is a bit frustrating.

 

I think the workaround to this is going to have to be that I set dates as dumb numbers; so perhaps 14th of March 1870 has to be 1870.0314 (so that I can calculate whether dates are before or after each other).

 

Or are there any better ways of doing it?

 

And is allowing dates prior to 1904 a feasible wishlist item?

Link to comment

So after a bit more fiddling around:

 

- actually the date thing is academic anyway because it doesn't look like data vis is able to understand dates - as in, I can't specify a date range, only a number range in the display criteria. Is that right?

 

- it's still the case that there's not a simple criteria to make an object "visible" or "not visible" - has to be done by setting the fill and pen to "none"

 

- am I right to understand that although I can have more than one data vis active at once, I can't apply more than one data vis to an object? For example, I can't ask an object to be displayed with a fill colour according to one criteria, and a pen colour according to another?

  • Like 1
Link to comment

I just tried this in VW2022 and it appears that you are correct you can not use different attributes from different Visualizations at the same time. The last  Visualization to match the object appears to set all the attributes for the object.

 

Correct there is not a Visible/Invisible setting as part of Visualizations.  A work around for this could be using Custom Visiblity (add to your workspace from the Legacy commands) to create a script that will Show/Hide objects based on the criteria you want. Then paste that script into the Script box of a Saved View. Then when you call up the Saved View it will run the script.  If you do go with Custom Visibility, make sure the first script you have it save is Show with a Criteria of All Objects. That way you can get everything back to visible while you are working on getting any other scripts to work properly.

 

I think it MIGHT be possible to get dates in ranges to work if you format the date field to YYYY/MM/DD. But I don't think it is being pulled into the visualization as a number but rather as a string.

 

1/1/1904 is the Mac default "Day Zero" dates on the Mac stored as numbers are actually the number of seconds since that date.  Linux/Unix use a date starting in 1970.  Yes, there are ways to work around that and get previous dates, but I don't think they have been implemented in VW as of 2022.

Link to comment
3 hours ago, Pat Stanford said:

I just tried this in VW2022 and it appears that you are correct you can not use different attributes from different Visualizations at the same time. The last  Visualization to match the object appears to set all the attributes for the object.

 

This is a little disappointing because I thought part of the point of it was to allow you to give an object several parameters and then adjust its display appearance according to more than one of them (which is what controlling appearance by class lets you do).

 

Also...why then does this dialogue exist?

 

333722039_Screenshot2022-08-11at23_38_28.jpg.7fba7418f2d2ef95554dc386ee763b62.jpg

 

I actually have managed to get both of those data vis working together (see the test file I've attached) but only if I apply them in a certain order - if I apply the "hide if opened after 1910" one and then apply the "colour by company" one I get what I want (all lines that opened after 1910, coloured according to company).

 

But if I apply them in the reverse order, the "hide" one doesn't have any effect.


 

 

 

 

3 hours ago, Pat Stanford said:

 

Correct there is not a Visible/Invisible setting as part of Visualizations.  A work around for this could be using Custom Visiblity (add to your workspace from the Legacy commands) to create a script that will Show/Hide objects based on the criteria you want. Then paste that script into the Script box of a Saved View. Then when you call up the Saved View it will run the script.  If you do go with Custom Visibility, make sure the first script you have it save is Show with a Criteria of All Objects. That way you can get everything back to visible while you are working on getting any other scripts to work properly.

 

Thanks. The setting line and fill to "none" seems a less complicated option if it works.

 

 

3 hours ago, Pat Stanford said:

 

I think it MIGHT be possible to get dates in ranges to work if you format the date field to YYYY/MM/DD. But I don't think it is being pulled into the visualization as a number but rather as a string.

 

I think I tried that but without success.

 

 

Link to comment

By the way while I'm here, a UI inconsistency complaint. The data vis dropdown.

 

484438392_Screenshot2022-08-11at23_45_39.jpg.6e601de68f216eb3f76d22c9bb1869a4.jpg

 

Those ticks, we are trained elsewhere to expect only to be able to select one thing and that's how it works in that drop down initially - you can only select one at a time.

But then if you go to "select multiple visualisations" (why's that a separate dialogue anyway??) and you can select both. And you come back to this menu and there are two ticks there. And to me, what's expected is that if I click on one of them it'll toggle it on and off. But no, clicking one of them selects that as the only one and turns the other off.

 

Also, having to click that <None> text to turn them all off feels clunky and messy.

 

Link to comment

So ... I've had some success in getting things to do what I want, using data vis on viewports. This has relied on hiding objects by setting pen & fill to "none".

 

For my current scenario, where it's all in top/plan view and simple geometry, this works, and I can "hide" objects according to the criteria I want to set.

 

However I've run into problems now I want to include text objects in the same system. This is because text takes its colour from "pen" colour - however it ignores the pen being set to "none". In other words I am unable to hide text by setting pen to "none".

 

But... it looks like I may be able to get around this by leaving "pen" solid, and setting to over-ride opacity to 0% instead ...

 

Edited by line-weight
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...