Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Editable Text in Library parts
March 16, 2013
7:11 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Thank you so much for the videos.
They solved 95 % of my question
I just have one minor issue to resolve
Previously we use to create our 2D items with grouped components, including text.
We would set the text with an insertion point and make its properties "always readable"
This meant that when rotating it or mirroring it, the text would be always readable
Creating this as an object is such a better way to do it but even though we set the text properties as "always readable", when we create the object, it loses this property.
Is there a way to set the text parameters as "always readable" in the object creation?
Trying to insert an image to explain but not sure if this will work

/Users/PeterMcLean/Desktop/2013-03-17_12-01-44.jpeg

March 16, 2013
9:28 pm
Avatar
Admin
Administrators
Forum Posts: 380
Member Since:
February 2, 2009
sp_UserOfflineSmall Offline

Peter -

I understand your question and what you are trying to achieve. The GDL script can be edited to make the object even smarter, however one has to do this carefully to make sure it works properly.

There is a line towards the very end of the 2D script that actually places the text (either a single line or multiple lines, in the two examples I gave) which starts with the command "richtext2". The actual contents of this line will vary depending on where you drew the object on the plan and some other factors.

Here is that line of the script as it reads in my object:

richtext2 16'-7.0131", 36'-5.3675", "AC_TEXTBLOCK_6"

Copy the x and y position coordinate values (in this case: 16'-7.0131", 36'-5.3675") to the clipboard, then replace them with 0, 0 so the line reads:

richtext2 0, 0, "AC_TEXTBLOCK_6"

Then add several lines just before this line:

add2 16'-7.0131", 36'-5.3675"
rrr = request("View_Rotangle", "", viewRotation)
mul2 1 - 2*symb_mirrored, 1
rot2 -symb_rotangle - viewRotation

and also add one line after the "richtext2" line:

del 3

Note that the actual coordinate values in the "add2" statement are the values that you copied from the original richtext2 line (that's why you copied them to the clipboard).

To summarize, in my example, the single line:

richtext2 16'-7.0131", 36'-5.3675", "AC_TEXTBLOCK_6"

ends up being replaced by:

add2 16'-7.0131", 36'-5.3675"
rrr = request("View_Rotangle", "", viewRotation)
mul2 1 - 2*symb_mirrored, 1
rot2 -symb_rotangle - viewRotation
richtext2 0, 0, "AC_TEXTBLOCK_6"
del 3

If you do this properly, and resave the object, you will find that the text remains horizontal (or in whatever orientation it was originally) even when the object is rotated and/or mirrored and even if you rotate the onscreen view (AC13 and later has this rotated view option).

Try it out and see if you can get it to work.

Eric

Eric Bobrow, Principal, Bobrow Consulting Group – Creator of MasterTemplate – The Office Standard for ArchiCAD – http://www.bobrow.com http://www.actemplate.com

March 16, 2013
10:00 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Hello Eric,
I appreciate your help
It is probably well outside the bounds of what one could expect but since I am this close could I indulge you a little more?

I think I am doing exactly what you said but I am getting "Illegal character in GDL source at line 55….
I then get "Missing comma in parameter list at line 55

This is the last line of my GDL script before changing it:

richtext2 20.92904455, -25.63630418102, "AC_TEXTBLOCK_22"

and I am replacing with this (all I am doing is cutting and pasting your text):

add2 20.92904455, -25.63630418102

rrr = request("View_Rotangle", "", viewRotation)

mul2 1 – 2*symb_mirrored, 1

rot2 -symb_rotangle – viewRotation
richtext2 0, 0, "AC_TEXTBLOCK_22"
del 3

After I get the error messages, it highlights the four lines before richtext2
I am using AC16 does this matter?

March 16, 2013
10:06 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

I just thought to count the lines and the line 55 with the error is the first line starting with add2

March 16, 2013
11:23 pm
Avatar
Admin
Administrators
Forum Posts: 380
Member Since:
February 2, 2009
sp_UserOfflineSmall Offline

Peter -
It is possible that when you are copying and pasting from this forum posting that some of the invisible web formatting characters are being carried over. Try copying and pasting one line at a time, and manually adding a line break between the script lines (hitting the Enter or Return key). Let me know if that helps.
Eric

Eric Bobrow, Principal, Bobrow Consulting Group – Creator of MasterTemplate – The Office Standard for ArchiCAD – http://www.bobrow.com http://www.actemplate.com

March 16, 2013
11:24 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

OK,
Will give that a go

March 16, 2013
11:29 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

GREAT !!!!
I actually typed the whole thing and that worked
I can now save the text and copy and paste that
Thank you so much for your help
LaughLaughLaughLaughLaughLaughLaughLaughLaughLaugh

March 17, 2013
12:00 am
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Bit more testing and it is not quite how I want it yet
I have objects that are rectangular with text in them
If I rotate 180 deg this works fine
But if I rotate 90 deg the text appears horizontally across the rectangle.
In the "Text Selection Settings" dialogue box, there is a check mark for "always readable"
This means the text will rotate to the angle you set but will always be "readable" from the bottom of the sheet or the right - never the left or upside down
This is what I was trying to achieve but this might tax your generosity too much - OR may just be too hard Wink

March 17, 2013
1:31 am
Avatar
Admin
Administrators
Forum Posts: 380
Member Since:
February 2, 2009
sp_UserOfflineSmall Offline

Peter -

Here is a slightly revised version that will allow your text to rotate but keep it readable (it will flip over when necessary):

add2 ORIGNAL-X-VALUE, ORIGINAL-Y-VALUE
viewRotation = 0
rrr = request("View_Rotangle", "", viewRotation)
mul2 1 - 2*symb_mirrored, 1
if symb_rotangle > 91 and symb_rotangle < 271 then
rot2 180
else
rot2 0
endif

richtext2 0, 0, "AC_TEXTBLOCK_6"

del 4

NOTES: Be sure to change the "del" statement to "4" rather than 3; also be sure to use the original x and y values, and the original TEXTBLOCK value from your own symbol script - don't just copy those lines from this forum post. And of course, if you get a GDL error message, you may find it goes away when you type the script in manually rather than copying and pasting from here.

Eric

P.S. ACKNOWLEDGMENT: I adapted this script excerpt from the GDL Handbook by Cadimage, an excellent resource. I could have painfully figured this out myself (I am a GDL expert) but sometimes it's best to just look it up!

Eric Bobrow, Principal, Bobrow Consulting Group – Creator of MasterTemplate – The Office Standard for ArchiCAD – http://www.bobrow.com http://www.actemplate.com

March 17, 2013
1:45 am
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Thank you again Eric
I am giving it a try now
We actually use Cadimage "Revisions" - a great time saver
I've never studied GDL so appreciate your help
I will post the result after dinner

March 17, 2013
3:29 am
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Well, I gave that a go and it still doesn't work for the text and it sends all the object hotspots off in all directions.
I wonder if that is because the hotspot definitions come after the text?
Should I be changing that too?
I also note that the dash in the mul2 line (when copied) doesn't work. I have to replace it with a keyboard dash

This is the end part of the script:

add2 51.89482981108, -27.78227375105
viewRotation=0
rrr=request("View_Rotangle", "", viewRotation)
mul2 1-2*symb_mirrored, 1
if symb_rotangle>91 and symb_rotangle<271 then
rot2 180
else
rot2 0
endif
richtext2 0, 0, "AC_TEXTBLOCK_38"
del 4
pen penAttribute_11
hotspot2 51.60931733485, -28.51232118668
hotspot2 51.65931733484, -28.51232118668
hotspot2 51.50390159998, -27.77956086422
hotspot2 52.52890159998, -27.77956086422
hotspot2 51.40390159998, -27.28079807615
hotspot2 51.40390159998, -27.60114722772
hotspot2 51.40390159998, -27.95797450073
hotspot2 51.40390159998, -28.27832365229

Any ideas?

March 17, 2013
6:25 pm
Avatar
Admin
Administrators
Forum Posts: 380
Member Since:
February 2, 2009
sp_UserOfflineSmall Offline

Peter -

Try "del 3" rather than "del 4". I think I made a mistake, which didn't matter for my object because the hotspots were scripted before the rest of the symbol.
Let me know if that resolves your issue.

Eric

P.S. FYI - "del" refers to "deleting" transformations - movements in the coordinate space such as mul2 (multiplying and scaling), rot2 (rotating) and add2 (movement to a new position). In general, in a GDL script, one or more transformations are applied before an element or set of elements are drawn, then to "return to home base" these transformations are deleted. It is important that the number of transformations is counted (e.g. 3 vs. 4) so that the "del" statement matches.

Eric Bobrow, Principal, Bobrow Consulting Group – Creator of MasterTemplate – The Office Standard for ArchiCAD – http://www.bobrow.com http://www.actemplate.com

March 17, 2013
10:33 pm
Avatar
Member
Users
Forum Posts: 11
Member Since:
February 28, 2013
sp_UserOfflineSmall Offline

Thank you Eric
That fixed it all
Can't praise you enough for your help

NOW.... to get to transforming your Master Template for our use (Consulting Engineers).
Going to be a bigger proposition than I thought but in the end will be worth it - I can tell already

LaughLaughLaughLaughLaughLaughLaughLaughLaughLaugh

May 1, 2016
4:42 am
Avatar
New Member
Users
Forum Posts: 2
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

Hi Eric
This is great and works well but are you able to tell me how i can get the text to remain in the same location in relation to the object as if the test remains in it's center point.

I've created an object with text above it but when I rotate it or mirror it the text is at the bottom which is where I want it but the text is upside down. Once I change the code the text is up the right way but next to the object not below it. This means if I have a row of these objects the text covers the next object. I would like the text to remain in the same location in relation to the object but the text to be readable.

Is there a way to do this.

Regards

May 1, 2016
12:26 pm
Avatar
Admin
Administrators
Forum Posts: 380
Member Since:
February 2, 2009
sp_UserOfflineSmall Offline

Hi Brad -

I think the issue you are seeing can be resolved with proper use of the "anchor" for your text block. Just as in the standard drawing windows in ArchiCAD (e.g. plan, section, elevation, details, etc.) text can be anchored based on a corner, midpoint or center-center. In GDL this is often set with the DEFINE STYLE command or variations such as DEFINE STYLE{2}, which determines font, size, alignment as well as anchor point (see pages 228-229 in the ArchiCAD 19 GDL Reference Guide) . Some GDL text commands may include this in the actual command (rather than looking at a separate style), for example TEXTBLOCK has an anchor parameter (see page 231).

For your purposes, set the anchor to 5, which will lock the centerpoint of the text in place. Rotations will happen around the center, keeping the text in the same location in relation to the object.

If you are placing text graphically as part of creating your object, make sure you use the anchor option in the same way. All text blocks that you place into a drawing window have an anchor - often users ignore this and simply move the text block around after it's placed. However if you set it at the centerpoint, then your text will remember that and if it gets bigger or smaller or the rotation angle is changed by a script in GDL, or directly in the drawing window (with the "keep readable" parameter or "lock angle" option) the anchor point will remain in the desired location.

Eric

Eric Bobrow, Principal, Bobrow Consulting Group – Creator of MasterTemplate – The Office Standard for ArchiCAD – http://www.bobrow.com http://www.actemplate.com

May 1, 2016
3:09 pm
Avatar
New Member
Users
Forum Posts: 2
Member Since:
May 1, 2016
sp_UserOfflineSmall Offline

Thanks Eric

You rule. That sorted it out just by changing the anchor before creating the object.

Cheers

Brad

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 108

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Member Stats:

Guest Posters: 1

Members: 1747

Moderators: 4

Admins: 3

Forum Stats:

Groups: 3

Forums: 11

Topics: 288

Posts: 837