cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

controlling text rotation

Anonymous
Not applicable
I'm working on a duplex receptacle part that uses the object ID to add text to indicate mounting height and other information. I've got the ID request working, but I need to know how to do 2 things:

1. Change the rotation of the text so it reads from the bottom of the page when the object rotation is >0. I assume I can use ><= with a range if numbers in an IF/THEN, arrangement to add some rotation adjustment around the anchor point, but if anyone knows a better way, please let me know.

2. How to properly make use of the stw string function. My txt_adj isn't coming up with the proper amount - see the attached screenshot. Per the code:

Define Style txt "Arial", txt_sz, 5, 0
txt_adj=.5*STW(mkr_ID)/1000*A_

Pen txt_pen
ADD2 0, 12"+txt_adj !!!!12" moves the origin to the outside of the receptacle
Style txt
rot2 90
Text2 0, 0, mkr_id

Shouldn't 1/2 the stw put the origin of the text in the proper spot so that when the text is entered, the edge of the text reaches back to the 12" mark? It appears to be starting the text left justified as is I was using 4 instead of 5 for my anchor point.

If this email isn't clear, I'll try to explain further, but I hope its obvious what I'd like to accomplish. Any help would be appreciated!

Wes

Picture 1.jpg
10 REPLIES 10
Anonymous
Not applicable
sure - why not...
!!!!!!!!!!!!!!!!!!!!!!Draw 2D symbol
HOTSPOT2 0, 0
HOTSPOT2 0, 5.5"
HOTSPOT2 0, 11"

PEN pencolor
LINE2 1", 0, 1", 11"
LINE2 -1", 0, -1", 11"
CIRCLE2 0, 5.5", 4"

PEN 2
LINE2 4", 0, -4", 0


!!!!!!!!!!!!!!!!!!!!!!!Text ID
txt_sz  = txt_sz*0.3528
Define Style txt "Arial", txt_sz, 5, 0
Request("ID_of_Main", "", mkr_ID)
Style txt
txt_adj=.5*STW(mkr_ID)/1000*A_
Pen txt_pen

!!!!!!!!!!!!!!!!!!!!account for mirrored object
IF V~ = 1 THEN
	mir_adj = 180
ELSE
	mir_adj = 0
ENDIF

!!!!!!!!!!!!!!!!!!!control text rotation

IF W~ <= 	224	THEN rot_adj=180+mir_adj
IF W~ >		224	THEN rot_adj=0+mir_adj
IF W~ <		30	THEN rot_adj=0+mir_adj

!!!!!!!!!!!!!!!!!!!set default location
ADD2	0, 12"+txt_adj
rot2 90+rot_adj

HOTSPOT2	txtA, 0, 4, txtB, 1+128 
HOTSPOT2	txtA, -1, 5, txtB, 3 
HOTSPOT2	txtA, txtB, 6, txtB, 2 

HOTSPOT2	0, txtB, 7, txtA, 1+128 
HOTSPOT2	-1, txtB, 8, txtA, 3 
HOTSPOT2	txtA, txtB, 9, txtA, 2

!for use only if hotspot is disabled
!txtA=0
!txtB=0

Text2 txtA, txtB, mkr_id