GDL prob with text anchor pt rot and maintain text orient

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-14 08:53 PM
When I have the text orientation options the anchor point of the text no longer is the same as the graphical hotspots. I tried many ADD2 and ROT2 options for the text location textx and texty with no acceptable results.Can someone point me in the right direction?
! graphical hotspots seripting
!!!!!Text ----------------------------------------
PEN txtpen
IF tr=1 THEN !HORIZONTAL TEXT
ROT2 -symb_rotangle
ENDIF
IF tr=2 THEN ! VERTICLE TEXT
ROT2 -symb_rotangle+90
ENDIF
IF tr=3 THEN !SMART ORIENTATION
mul2 1-2*symb_mirrored,1
IF symb_rotangle>90 AND symb_rotangle<270 THEN
ROT2 180
ELSE
ROT2 0
ENDIF
ENDIF
DEFINE STYLE "symtextstyle" font, 1/(2.83464567)*fontsz, txtanchor, txtFaceCode
SET STYLE "symtextstyle"
TEXT2 textx,texty , switch_text
DEL 1
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System
"Implementing Successful Building Information Modeling"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-14 09:32 PM
My first impression is that you miss to DEL the MUL transformation...
Try:
ROT2 -sgn (1 - 2 * symb_mirrored) * (symb_rotangle * (tr >= 1) - 90 * (tr = 2))HTH
DEFINE STYLE "symtextstyle" font, 1/(2.83464567)*fontsz, txtanchor, txtFaceCode
SET STYLE "symtextstyle"
TEXT2 textx,texty , switch_text
DEL 1
edit: I did a little modification on the transformation... it seems to work now.
...and I have a question... Why a 3rd status "Smart"?... Shouldn't they all be smart?...


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-14 10:30 PM
I tried your code, but it isn't giving me the results I am hoping for. When we are working in AC often we place for example a light switch symbol and mirror and rotate copies of the symbol as we go about placing them. My test is to place a symple in the plan and then rotate 15 copies and then mirror this wheel of symbols to see what happens.
I am attaching two screenshots to show. When I select one of the nonvertical switches, I notice the anchor point of the text no longer matches the graphical hotspot. Moving the graphical hotspot to move the text is now bizarre. It is difficult to accurately move the actual text.
The text keeps being placed relative to the base of the switch.
As to the three text orientations, I work with a number of firms. While I use the 'smart' option, some firms have strict rules about all texts being vertical or horizontal relative to the screen. I added this drop down choices for them and also as an exercise for me with value lists

Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System
"Implementing Successful Building Information Modeling"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-14 10:30 PM
I tried your code, but it isn't giving me the results I am hoping for. When we are working in AC often we place for example a light switch symbol and mirror and rotate copies of the symbol as we go about placing them. My test is to place a symple in the plan and then rotate 15 copies and then mirror this wheel of symbols to see what happens.
I am attaching two screenshots to show. When I select one of the nonvertical switches, I notice the anchor point of the text no longer matches the graphical hotspot. Moving the graphical hotspot to move the text is now bizarre. It is difficult to accurately move the actual text.
The text keeps being placed relative to the base of the switch.
As to the three text orientations, I work with a number of firms. While I use the 'smart' option, some firms have strict rules about all texts being vertical or horizontal relative to the screen. I added this drop down choices for them and also as an exercise for me with value lists

Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System
"Implementing Successful Building Information Modeling"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-15 01:28 AM
I would suggest to keep the anchor point in the middle and doing
...all the moving first
...then text rotation
...and lastly place the text at point 0, 0
Hope this helps, works nicely with my little projects.
--
Regards, Juha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-15 01:46 AM
You jumped ahead to the anchor point problem. Some symbols have two lines of text. How do you keep them from running into one another when the scale changes? Or when someone changes the font size?
thanks!
Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System
"Implementing Successful Building Information Modeling"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-15 09:23 AM
Could be arranged by using anchor point 5 with the
one line text. If there are two lines then the upper
has anchor point 8 and the lower line has 2.
The textblock command is a powerful solution if the
number of the lines is not known ie. the text is long
and the user is allowed to adjust the text field width.
You can request a textblock's dimensions before placing it
so centering it is not a problem.
Might be an overkill solution if only a couple of words and
lines are used.
--
Best regards, Juha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-15 12:48 PM
"Erika Epstein" but it isn't giving me the results I am hoping for.[/quote wrote:
Sorry Erika... I didn't test the script...
Here is a screen shot of an object which I have created based on your script... It seems to be ok on your "crash test"...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-15 12:49 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2009-08-17 07:42 PM

Architect, Consultant
MacBook Pro Retina, 15-inch Yosemite 2.8 GHz Intel Core i7 16 GB 1600 MHz DDR3
Mac OSX 10.11.1
AC5-18
Onuma System
"Implementing Successful Building Information Modeling"