Setting X Position Of Object B Based On X + Width Of Object A S’abonner

0
Avatar
Legacy Poster

Hello !  Both objects are text objects.  We would like to set the X position of Object B based on the X position + Width of Object A plus an offset.  In other words we want to position the start of Object B just to the right of the end of Object A, and Object A can vary in length.  Both objects are getting data from a database record.

 

We have BT v10.1 Enterprise.

 

I put the following code in the OnNewRecord event of the BarTender Document Options:

 

Format.MeasurementUnits (Inches)

txt10x = Format.Objects("Text 10").X

txt10w = Format.Objects("Text 10").Width

Format.Objects("Text 12").X = txt10x + txt10w + 0.19

 

The Text 12 object is a text paragraph type.

 

Result: The Text 12 object X position does not vary - it stays the same from record to record.

 

The btw and associated data file are both attached.

 

Any help is appreciated.

 

Regards,

 

Jim Ralph

General Atomics San Diego, CA

 

 

5 commentaires

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

There are not many records in your datafile to test with, but my test showed it worked.

 

Are you actually printing or print previewing the records to test? Or just clicking through the arrows in the design screen? If you print preview the job it should work.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Hi nRyder

 

I'm doing actual printing to test - sending the btw data records with a database (text) file.  In doing so, I'm observing that the Text 12 object gets overwritten by the end of the Text 10 object - the Text 12 object's X position does not move to the right and start with an offset from the end of the Text 10 object.

 

Thank you for helping!

 

Regards, jr

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I see. Have you tried instead putting the script in "OnIdenticalCopies" instead of "OnNewRecord"?

This should confirm it runs for every single label printed - just in case.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Just tried that - in OnIdenticalCopies ... no joy.  SS Support Tech is now saying it looks like a bug and they are investigating it.  Thank you sir for your assistance.  I shall report back when I know more info.  Best regards.

0
Avatar
Soslticemoon
Actions pour les commentaires Permalien

Good Day!

I want to adjust the horizontal position of one text box based on the record-specific (variable) width of an adjacent text box.

I am trying to do this because one textbox needs to be boldfaced while the adjacent box must be plain, but I need them to appear as a single line of text.

I have tried from OnNewRecord, OnIdenticalCopies, and OnSerialize.The width value is always returned from the Design View.

 

Thanks!

 

Vous devez vous connecter pour laisser un commentaire.