Jump to content

Dynamic Box Margins


Recommended Posts

I have a D.T. w. a rectangle bounding box that I want to re-size with data edits (to track a margin w. the longest of 5 fields).  So far, in trying different settings, I either get no margins or text fields that expand in  unwanted ways.  I have a similar D.T. (but, w. only 2 fields) that works as-expected with the same settings.

 

Anyone give me a hint as to what I've missed...?

 

Change Data Tag.vwx

Link to comment
  • Vectorworks, Inc Employee

Hello @C. Andrew Dunning, @KIvanov,

 

When all texts are set to constrain to the right this means that the longest of them will pull the others with itself and that is why you see weirdly sized texts. What the right constraint does is that it fixes the distance between the right edge of the text and the boundary, so basically it tries to keep the same distance as set in the layout edit mode. I have added some extra spaces in the texts in the layout just to make them roughly the same width and this gave similar results to the one without right constraint but it still has some margin. I could not think of any other solution to this.

 

Let me know if that helps.

 

Best Regards,

Nikolay Zhelyazkov

Change Data Tag with spaces in layout.vwx

  • Like 1
Link to comment
  • Vectorworks, Inc Employee
1 hour ago, C. Andrew Dunning said:

I believe there might be a bug related to the text block re-sizing.  I understand how the alignments are supposed to work but the tool is adding unnecessary spaces.  See the instance in the attached file with only "-" in the 3 User-Entered Fields.  Compare with the PIO Data-associated fields in the Seating Section label D.T.

- It is working as expected, in the layout you have stated that you want the date and time to have a fixed distance to the right side of the boundary by selecting their right constraint as shown in the image below:

 

image.png

 

You have done the same for the other dynamic texts too. When you exit the layout you can see that the date text, which is the longest, has this fixed distance:

image.png

 

In order to do the same for the other texts, since they have right constraint selected, we have to resize these texts and make them with a fixed width, which looks like they have extra spaces added.

 

Let me know if you still think that this is not working as expected.

 

Best Regards,

Nikolay Zhelyazkov

  • Like 1
Link to comment
24 minutes ago, Nikolay Zhelyazkov said:

Let me know if you still think that this is not working as expected.

 

No; it isn't.

 

Using the image you referenced, Date is the longest.  In-theory, the other fields should stretch to match it and the margin should be relative to that stretched width.  Instead, "Department" is stretched far beyond what it should be and the margin references that field.  - OR -  As Date is the longest, the margin should reference that field and the other fields should stretch to fit the margin.

 

Again...the desired outcome is that the right side of the box is constrained to a given distance from the widest field - which could be any of the 5.

 

34 minutes ago, Nikolay Zhelyazkov said:

image.png

 

Look again at the graphic you posted.   Date is the widest, but the other 4 fields are stretching beyond its width - for Time, a little and for Department quite a bit - and the margin is referencing the resulting widest field, which is Department.  So...the margin might be behaving correctly but the stretching of the 5 fields is not.

 

 

Link to comment
  • Vectorworks, Inc Employee
14 minutes ago, C. Andrew Dunning said:

Again...the desired outcome is that the right side of the box is constrained to a given distance from the widest field - which could be any of the 5.

Again, this is the desired outcome but not how the system is designed to work. You have specified that you want fixed offset from the right side of all texts to the right of the boundary. This means that all texts have the same distance from the right as they have in the layout(when you apply layer scale). If you measure this you will see that this is true. There is currently no way to tell that you want only the longest text to be with fixed distance, because you can only set that you want fixed distance between a text and the boundary. You can achieve what you want if you constrain only the widest text to the right but the problem is that you do not know which is the widest text as its content is dynamic and changes with each data tag.

 

You can add a wishlist item for the desired outcome and it will be considered.

Link to comment
1 minute ago, Nikolay Zhelyazkov said:

@C. Andrew Dunning Here is an image showing how the fixed distance constraint is working as designed.

 

image.png

 

I don't think you are understanding what I'm saying.

 

Yes; the fixed distance constraint IS working - relative to "Department."  The desired margin IS 1/8".

 

BUT,  Department (and, the other fields) is stretching incorrectly.

Link to comment
  • Vectorworks, Inc Employee
Just now, C. Andrew Dunning said:

 

I don't think you are understanding what I'm saying.

 

Yes; the fixed distance constraint IS working - relative to "Department."  The desired margin IS 1/8".

 

BUT,  Department (and, the other fields) is stretching incorrectly.

Yes, they are stretching because you have specified that you want their right edge to be with fixed distance to the boundary and this is what happens. Clearly visible in the attached image above. I am sorry if my explanation and the image are not explaining well enough how the system works but I cannot explain it in another way. What you are looking for is currently not possible and is a wishlist request.

Link to comment
11 minutes ago, Nikolay Zhelyazkov said:

There is currently no way to tell that you want only the longest text to be with fixed distance, because you can only set that you want fixed distance between a text and the boundary. You can achieve what you want if you constrain only the widest text to the right but the problem is that you do not know which is the widest text as its content is dynamic and changes with each data tag.

 

1)  This is not what has been said in the past.  Other engineers have affirmed that what I am wanting to do is possible - as shown in the other D.T. in the file I posted.  The solution in that D.T. is what was suggested by another engineer.

 

2)  Even when I pick one of the 5 fields to use as a single reference - 1 that I assume will be the longest - things still do not work correctly.  I tried that before submitting my initial question.  I am 100% open to your showing me that working w. a single-field reference...

Link to comment
  • Vectorworks, Inc Employee

Here are some attempts to achieve what you want with a single text constraint. However, as I have already said, the constraints just keep fixed distance, they do not set margins. I have nothing more to add here, maybe you can ask the people who told you that this is possible how they made it work for them.

 

 

1242968376_ChangeDataTag-2examples.vwx

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

Can't you just use a uniform '#' for all of the placeholder texts? Then the rectangle will expand to the width of the longest text in the instance of the tag. Or maybe I misunderstood the issue.

 

Yes and No...

 

The default field contents and the dialog label are one-in-the-same.  So..."#" wouldn't be appropriate.  -BUT-  Changing the defaults/labels to shorter strings works beautifully.  So..."Name," "Dept.," and "Change" work.

 

So...the box WILL change dynamically as-desired but its starting-point reference is a function of the DEFAULT string length AND the Dynamic.

 

So...good call!

 

Link to comment
8 minutes ago, C. Andrew Dunning said:

The default field contents and the dialog label are one-in-the-same.  So..."#" wouldn't be appropriate.

 

Aha ok I see what you mean. I didn't realise it was user-entered data + you need the text for the identification of the fields in the 'Edit Tag Data' dialog. In that case what you could do is add spaces after the shorter words to make them all more or less the same length as the longest ('Change'): that will get the most accurate results in terms of the size of the rectangle relative to your text whilst retaining the labels you need in the 'Edit Tag Data' dialog.

 

 

 

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