Jump to content

Un-associated data tags: can one field be determined by another?


Recommended Posts

I've never really used data tags - but am starting to use them a little bit without actually associating them with any objects.

 

Essentially I'm using them as a convenient way to place window/door/room labels.

 

For example I have window labels set up like this - with simple drop-downs (that can be accessed just by double-clicking on the tag) to choose from:

 

Screenshot2023-12-04at13_24_12.jpg.04eb1f537dbf68c791a0045fa5712879.jpg

 

I also have a room number version

Screenshot2023-12-04at13_26_01.jpg.f136e7482e89189d8e54964e6c51b45f.jpg

 

Within a single project, if room 1.01 is a bedroom, then in every viewport where I want to place a room number tag and choose number 1.01, I want it also to say "bedroom".

At the moment I just do that manually - I choose all three fields manually.

 

Is there any simple way to set things up so that if I choose room number 1.01, it will automatically fill in the name field as "bedroom"? For example can the tag somehow refer back to a worksheet somewhere, where I make a table of room numbers & names? Or is this a stupid question and I should just be using it as intended, that is it should be associated with a space object on the design layer? (I've never bothered using spaces)

 

Alternatively, is there a clever way of having a dropdown where one of the options include "1.01 Bedroom" and it will put the number & text into the two lines as per my screenshots above?

 

 

 

 

 

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

Is there any simple way to set things up so that if I choose room number 1.01, it will automatically fill in the name field as "bedroom"? For example can the tag somehow refer back to a worksheet somewhere, where I make a table of room numbers & names? Or is this a stupid question and I should just be using it as intended, that is it should be associated with a space object on the design layer? (I've never bothered using spaces)

 

Alternatively, is there a clever way of having a dropdown where one of the options include "1.01 Bedroom" and it will put the number & text into the two lines as per my screenshots above?

 

I don't think either of these things are possible but someone else may know better. When you say 'refer back to a worksheet somewhere' presumably you mean a dumb spreadsheet where you've entered the data manually? I think if you're going to go to this trouble you might as well enter that data into the objects instead - Doors, Windows, Spaces - then use the tags to return that info dynamically.

 

Spaces are quite quick + easy to create + I don't do anything particularly sophisticated with them: just use them as a means of labelling rooms in VPs like you're doing but with added benefit of giving me area + volume info too. Because the Spaces are there in the model it means you can tag them in any VP you want to add a room label. Plus I use them for generating a GIFA label which is quite important for planning apps.

 

I also think you'd be better off using the built-in ID number for Doors/Windows then returning that in a tag. It means you can add tags wherever you want - plans or elevations - and the ID will be returned correctly. Plus produce schedules.

 

Having said that I do have a kind of 'general notes' tag I use that works the same as your one: I enter notes for a project in a Record then call on them in the drop-down for the tag. This is because I was finding it so hard to associate the tag with certain objects in the drawing it was easier to just write the notes manually. This is trying to tag wall/slab/roof components in section VPs which is basically impossible most of the time in my experience.

Link to comment

When I said "refer back to a worksheet" perhaps what I mean is a record? But yes just a dumb table of some kind where I enter the info manually - and where I could change, say, a room code number and have it automatically update across the drawings.

 

I suppose I should try using spaces and also returning data directly from window/door objects. I feel like I quite often read comments about people having difficulty getting data tags to work properly so am not sure if that additional layer of faff is worth it for me, on projects that don't contain vast numbers of these objects. Plus a large proportion of my doors & windows often end up as custom built objects where it would be extra work to attach that data to them properly.

Link to comment
2 minutes ago, line-weight said:

When I said "refer back to a worksheet" perhaps what I mean is a record?

 

A Record still needs to be attached to an object, it can't just exist on its own. In my case the Record is attached to the Data Tag itself + it's just a way of having a central repository of notes + means I can change the Data Tag style without losing the data. but it's still just a manual entry system essentially. I could do it with callouts + the notes database instead, I just like the graphical control you have with Data Tags + means I can mix manual ones + dynamic ones + they look the same.

 

4 minutes ago, line-weight said:

Plus a large proportion of my doors & windows often end up as custom built objects where it would be extra work to attach that data to them properly.

 

I have a current project where I am using Velfac doors/windows throughout but one of the configurations was impossible to achieve with the Window tool (a V200 slider with fixed leaf) so I created it as a custom symbol + inserted it as a Window using 'Use symbol geometry' + that worked well. I could tag it + include it on the schedule + graphic legend.

 

But I agree, on many projects just because stuff happens automatically/dynamically doesn't necessarily mean it's significantly less work than doing it manually. But there is a lot of satisfaction to be had learning how these things work + getting them to work + it avoids a lot of error/manual updating.

 

 

Link to comment
3 hours ago, Tom W. said:

 

But there is a lot of satisfaction to be had learning how these things work + getting them to work + it avoids a lot of error/manual updating.

 

Agreed. It's certainly satisfying to get these things working (and once you do, you can recoup the benefits on future projects too). However, for myself I am conscious that it can become a procrastination device to avoid getting on with the proper work!

Link to comment
5 hours ago, Tom W. said:

A Record still needs to be attached to an object, it can't just exist on its own. In my case the Record is attached to the Data Tag itself + it's just a way of having a central repository of notes + means I can change the Data Tag style without losing the data. but it's still just a manual entry system essentially. I could do it with callouts + the notes database instead, I just like the graphical control you have with Data Tags + means I can mix manual ones + dynamic ones + they look the same.

Tom W. you get me in so much trouble. I think you are "wrong" 😉 about this one.

 

I have not tried it, but I think you could create a record format and use a #WS_ObjectData('Universal Value', format_name, field_name, true)# will return the value of a field in a record format. Replace format_name and field_name  with the record and field names.

 

Doing this you could create only a record format that would contain a value that could be used in multiple DataTags but defined in only one place. So if you changed the value (either in the Resource Manager or in a Worksheet) that value would change in multiple DataTag Styles.

 

But this is an all or nothing solution. The Record and Field will have to be manually hard coded into the DataTags.

 

I don't have a reason to do this, but I guess I can imaging cases where it would be useful.

 

🤷‍♂️

  • Love 1
Link to comment

Inspiring as ever Pat! I am tempted to try this out but is not something I think I'd ever use either...

 

If I understand correctly, it would require @line-weight to use a different tag for each note? He could have a single Record Format containing all the 'notes' (i.e. lots of different fields) but would need dedicated tags for each field?

Link to comment

Yes. You could have different Tags that used the same value, but since the Field would have to be hard coded, you would need a different Tag definition (Style) for each different field you wanted to show.

 

You might be able to get really fancy and attach a record to the tag itself and choose the field value from there, but I somehow think that would end up being fragile.

 

Quote

"What you are trying to do sounds fancy, and as such it sounds like it won't work.”

Vlado Stanev, VW SDK List Dec. 4, 2015

 

Link to comment
7 minutes ago, Pat Stanford said:

You might be able to get really fancy and attach a record to the tag itself and choose the field value from there, but I somehow think that would end up being fragile.

 

But this is what I do already, like I said above. The record has a pop-up with all my notes for the project then the tag reads the notes from the record.

Link to comment
31 minutes ago, Tom W. said:

 

But this is what I do already, like I said above. The record has a pop-up with all my notes for the project then the tag reads the notes from the record.

 

I think I still don't quite understand this. There is a data tag, and attached to this is a record, that has all of the info that you want for all data tags in the file? And then other data tags refer back to the record attached to this "master" data tag?

Link to comment
Just now, line-weight said:

 

I think I still don't quite understand this. There is a data tag, and attached to this is a record, that has all of the info that you want for all data tags in the file? And then other data tags refer back to the record attached to this "master" data tag?

 

I have a Record Format called 'Data Tag Notes'. It has a field called 'Saved Notes' + this consists of a pop-up list of notes. When I start a new file/project I will go through this list deleting irrelevant notes + adding new ones as required by the project.

 

I have a 'Saved Notes' Data Tag which has the 'Data Tags Notes' record attached to it + which returns the 'Saved Notes' field of the record. The tag is set up to 'Always display the Edit Tag Data dialog' on placement so when I place a tag I get the pop-up list of my notes from the record + I just choose the one I want to display.

 

So every tag I place has that record attached to it. It is just a stored list of notes. I can add notes as the project progresses. Like I said, it is basically a less sophisticated version of the database for Callouts, I just want to do all my tagging with Data Tags + this allows me to do it. I have wished elsewhere for the functionality whereby a Data Tag could access the notes database which would be preferable. I only started doing this because I was having so much trouble getting tags to return the data stored in various objects, in particular wall/slab/roof components in section VPs. It is a workaround.

 

I am not controlling the data displayed in the tags from the record. If I edit a note in the record + have to 'reset' the tag to have it display the edited note.

Link to comment
1 hour ago, Tom W. said:

 

I have a Record Format called 'Data Tag Notes'. It has a field called 'Saved Notes' + this consists of a pop-up list of notes. When I start a new file/project I will go through this list deleting irrelevant notes + adding new ones as required by the project.

 

I have a 'Saved Notes' Data Tag which has the 'Data Tags Notes' record attached to it + which returns the 'Saved Notes' field of the record. The tag is set up to 'Always display the Edit Tag Data dialog' on placement so when I place a tag I get the pop-up list of my notes from the record + I just choose the one I want to display.

 

So every tag I place has that record attached to it. It is just a stored list of notes. I can add notes as the project progresses. Like I said, it is basically a less sophisticated version of the database for Callouts, I just want to do all my tagging with Data Tags + this allows me to do it. I have wished elsewhere for the functionality whereby a Data Tag could access the notes database which would be preferable. I only started doing this because I was having so much trouble getting tags to return the data stored in various objects, in particular wall/slab/roof components in section VPs. It is a workaround.

 

I am not controlling the data displayed in the tags from the record. If I edit a note in the record + have to 'reset' the tag to have it display the edited note.

 

Ok, thanks.

 

Had to remind myself of exactly what Record Formats are and how they work.

 

I think I get it now.

 

I don't think I can use this to do quite what I want. My list in that pop-up could be

 

G.01 living room

G.02 kitchen

G.03 bathroom

 

etc and then if G.03 became a bedroom, I could change that in the record format pop-up (=drop-down?)  list and then it wouldn't automatically repopulate everywhere but I could go around and update by resetting as you say.

 

But it wouldn't let me put "G.03" and "bathroom" in different fields in the data tag and have them both updatable in conjunction with each other.

Link to comment
3 hours ago, Pat Stanford said:

Tom W. you get me in so much trouble. I think you are "wrong" 😉 about this one.

 

I have not tried it, but I think you could create a record format and use a #WS_ObjectData('Universal Value', format_name, field_name, true)# will return the value of a field in a record format. Replace format_name and field_name  with the record and field names.

 

Doing this you could create only a record format that would contain a value that could be used in multiple DataTags but defined in only one place. So if you changed the value (either in the Resource Manager or in a Worksheet) that value would change in multiple DataTag Styles.

 

But this is an all or nothing solution. The Record and Field will have to be manually hard coded into the DataTags.

 

I don't have a reason to do this, but I guess I can imaging cases where it would be useful.

 

🤷‍♂️

This works!

 

I have to double click each data tag to persuade it to update itself though.

 

Can I somehow use an "IF" type formula in there?

 

So, if a field name in the record format = X then write Y in the data tag?

Edited by line-weight
Link to comment

The attached file shows a data tag using a couple of different IF methods to access different data.

 

The file has a record format names Test1.  It has Fields: Red, Blue, Other.

 

The data tag is set up the way it is to kind of show how I go about creating complicated data tags.

 

The top text block has what we figured out a couple of days ago about how to pull data from a record format. This is there so I could make sure I knew what the value of the Color field is.

 

The middle text block has Five lines using a WS_IF statement. This started out as a single line, but I was having trouble getting the quotes and parentheses right. So I simplified the first line to make something more basic work. Then I started extra lines making each more complicated until I got the result I wanted.

 

The bottom text block uses what I learned in the second, but it uses and #WS_FIS( function.

 

In worksheets and data tags, the IF function takes a single logical results and returns one value if there logical is true and another if it is false. You can next multiple IF statements if necessary.

 

IFS is similar to IF, but it takes multiple sets of Logical and Result if that logical value is true.  The logicals have to be surrounded by Parentheses. The Results have to be either a string constant (ie surrounded by single quotes) or a function that returns a text value. The benefit of IFS is that you can put multiple different logicals into a single function while returning multiple different values.  The first logical that returns true will determine the Result that is returned. If the last logical is (ELSE), then anything that does not match any of the logical statement will have the last Result returned.

 

Hope this makes sense.  Because you have use such long statements for both the Logical and Result for the "references record" thing we are doing, they get hard to work with quickly. Getting all the parentheses and quotes straight is a challenge.

 

Data Tag WS_IFS.vwx

  • Like 4
Link to comment

Thanks for this. It will certainly be useful to have this to take a close look at if trying to set up something similar.

 

If I understand right, the data this is pulling is the "default" values for each field in the record format. And that record format just exists in the resource browser, it's not attached to any object in the drawing.

 

Would it also be possible to have it set up so that it pulls the values from an object in the drawing, which uses that record format? So it would be pulling the values contained in the fields associated with that object rather than the record format's default values.

 

Obviously in this case the formulas would have to specify exactly which object that was.

 

In the expressions you have used, does the term 'Universal' basically tell it to use the default values?

 

 

Link to comment
45 minutes ago, line-weight said:

Would it also be possible to have it set up so that it pulls the values from an object in the drawing, which uses that record format? So it would be pulling the values contained in the fields associated with that object rather than the record format's default values.

 

This is how Data Tags work as standard. Just set the Record Format as the Data Source.

Link to comment
14 minutes ago, Tom W. said:

 

This is how Data Tags work as standard. Just set the Record Format as the Data Source.

 

I guess I mean a scenario where the data tag is associated with an object but I want to pull data from some other object in the drawing.

 

For example I have 10 flowerpots each with different flowers in, and each has a data tag that lists what plants are planted in that pot. But the flowerpots are the same and I have a flowerpot specification. I'd like to show that in each flowerpot's data tag but I'd also like to be able to change that specification at a central location, which could be an unattached record format using its default values, like in @Pat Stanford's example. But could it also be in the form of a record attached to an object in the drawing.

Link to comment
1 minute ago, line-weight said:

For example I have 10 flowerpots each with different flowers in, and each has a data tag that lists what plants are planted in that pot. But the flowerpots are the same and I have a flowerpot specification. I'd like to show that in each flowerpot's data tag but I'd also like to be able to change that specification at a central location,

 

In a worksheet no?

Link to comment
19 minutes ago, line-weight said:

Pulling from a worksheet is one of the things I mentioned in my first post, yes, but as far as I understand this isn't actually possible.

 

Well I think earlier on you were suggesting something different. I'm talking about having objects in the drawing with data attached to them in the form of Record Formats. A worksheet will look for these objects + return the record data. You can edit that data in the worksheet + it will feed through to the record format fields for the objects. It is two way. If you then have Data Tags associated with those objects also returning that data, when you edit the data in the worksheet it will therefore be edited in the tags as well. You can also set up the tags so that they feed data in the other direction to the worksheet. My point earlier was that you need objects in the equation somewhere, you can't just have tags + a worksheet, although Pat proved me wrong on that when it came to tags + records so don't quote me on it!

 

When you talked about a data tag that lists what plants are planted in that pot I assumed you meant that data was attached to the flower pot object in the form of a Record.

Link to comment
9 minutes ago, Tom W. said:

 

Well I think earlier on you were suggesting something different. I'm talking about having objects in the drawing with data attached to them in the form of Record Formats. A worksheet will look for these objects + return the record data. You can edit that data in the worksheet + it will feed through to the record format fields for the objects. It is two way. If you then have Data Tags associated with those objects also returning that data, when you edit the data in the worksheet it will therefore be edited in the tags as well. You can also set up the tags so that they feed data in the other direction to the worksheet. My point earlier was that you need objects in the equation somewhere, you can't just have tags + a worksheet, although Pat proved me wrong on that when it came to tags + records so don't quote me on it!

 

When you talked about a data tag that lists what plants are planted in that pot I assumed you meant that data was attached to the flower pot object in the form of a Record.

 

I was imagining that the planting data would be in a record attached to each pot yes ... but that a data tag associated with a pot would show this info plus info pulled from elsewhere.

 

What I am asking/suggesting in this thread is probably a bit confused, because I haven't fully got my head around how all this works. In particular I don't use worksheets a lot.

 

I should probably come back to this when I have a bit more time to think this through more thoroughly... rather than asking further ill-defined questions just now.

Edited by line-weight
Link to comment

Normally in a case like this the worksheet is generated based on the data in a Record.Field attached to an object in the drawing.

 

But the current limitation to VW is that whatever data is in the Record Definition when the record is attached to the object in the drawing is the data that is attached to the object. If you later change the default values in the Record Definition those values do not propagate to the instances already in the drawing. 

 

This is a "good thing™" because this is what allows you to have different values for different instances. But it does make it difficult when you are trying to keep a field value in sync between multiple objects.

 

All of the ObjectValue formulas I worked out above just give you a way to use a Record Definition as a "single source" for values for multiple data tags.

  • Like 1
Link to comment
7 hours ago, line-weight said:

I guess I mean a scenario where the data tag is associated with an object but I want to pull data from some other object in the drawing.

You are going to have a very hard (Read as almost impossible) time getting a data tag to read data from another object. Data Tags are designed to return data from the associated object only.

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

If I understand right, the data this is pulling is the "default" values for each field in the record format. And that record format just exists in the resource browser, it's not attached to any object in the drawing.

 

Would it also be possible to have it set up so that it pulls the values from an object in the drawing, which uses that record format? So it would be pulling the values contained in the fields associated with that object rather than the record format's default values.

Correct what I have posted draws from the defaults of the record format.  Does not matter if the record is also attached to an object, it will always draw the defaults.

 

The Data Tag will not be able to pull from some other object in the drawing, only the object that it is associated with. To get that data all you need is to use the Record.Field options in the Data Tag Dynamic Text.

 

 

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