<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: controlling text rotation in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16378#M34684</link>
    <description>Without testing it, but the DEFINE defines the style. The STYLE sets the style. If you want to measure the text, you have to set the style before!&lt;BR /&gt;
&lt;BR /&gt;
DEFINE Style txt "Arial", txt_sz, 5, 0&lt;BR /&gt;
SEt STYLE txt&lt;BR /&gt;
txt_adj=.5*STW(mkr_ID)/1000*A_&lt;BR /&gt;
&lt;BR /&gt;
Pen txt_pen&lt;BR /&gt;
ADD2 0, 12"+txt_adj !!!!12" moves the origin to the outside of the receptacle&lt;BR /&gt;
rot2 90&lt;BR /&gt;
Text2 0, 0, mkr_id</description>
    <pubDate>Wed, 25 Jan 2006 17:49:51 GMT</pubDate>
    <dc:creator>Frank Beister</dc:creator>
    <dc:date>2006-01-25T17:49:51Z</dc:date>
    <item>
      <title>controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16375#M34681</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;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:&lt;BR /&gt;
&lt;BR /&gt;
    1.  Change the rotation of the text so it reads from the bottom of the page when the object rotation is &amp;gt;0.  I  assume I can use &amp;gt;&amp;lt;= 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.&lt;BR /&gt;
&lt;BR /&gt;
    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:&lt;BR /&gt;
&lt;BR /&gt;
Define Style txt "Arial", txt_sz, 5, 0&lt;BR /&gt;
txt_adj=.5*STW(mkr_ID)/1000*A_&lt;BR /&gt;
&lt;BR /&gt;
Pen txt_pen&lt;BR /&gt;
ADD2	0, 12"+txt_adj  !!!!12" moves the origin to the outside of the receptacle&lt;BR /&gt;
Style txt&lt;BR /&gt;
rot2 90&lt;BR /&gt;
Text2 0, 0, mkr_id&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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!&lt;BR /&gt;
&lt;BR /&gt;
Wes&lt;/T&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;IMG src="https://community.graphisoft.com/t5/image/serverpage/image-id/16939iF851F09CB5A69245/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Picture 1.jpg" title="Picture 1.jpg" /&gt;</description>
      <pubDate>Wed, 25 Jan 2006 16:00:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16375#M34681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-25T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16376#M34682</link>
      <description>I think you might be happier overall if you include a graphic hotspot instead of the STW offset thing. That would let you move the text on an individual basis (like it the text over-ran a wall or another outliet).</description>
      <pubDate>Wed, 25 Jan 2006 16:04:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16376#M34682</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2006-01-25T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16377#M34683</link>
      <description>yeah, I agree - but I have yet to be able to get a graphical  hotspot to work, even following the GDL manual.  I'll try grabbing code from another part, perhaps.  &lt;BR /&gt;
&lt;BR /&gt;
Wouldn't I still want to get the text in the right spot (using gdl) to begin with?  I'm trying to reduce the work people have to do - if they have to enter text and then drag it around everytime, they might as well just use an actual text element. I agree that having it movable is good so one could account for oddities in the plan - it just has to start in the "right" place by default.</description>
      <pubDate>Wed, 25 Jan 2006 17:08:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16377#M34683</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-25T17:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16378#M34684</link>
      <description>Without testing it, but the DEFINE defines the style. The STYLE sets the style. If you want to measure the text, you have to set the style before!&lt;BR /&gt;
&lt;BR /&gt;
DEFINE Style txt "Arial", txt_sz, 5, 0&lt;BR /&gt;
SEt STYLE txt&lt;BR /&gt;
txt_adj=.5*STW(mkr_ID)/1000*A_&lt;BR /&gt;
&lt;BR /&gt;
Pen txt_pen&lt;BR /&gt;
ADD2 0, 12"+txt_adj !!!!12" moves the origin to the outside of the receptacle&lt;BR /&gt;
rot2 90&lt;BR /&gt;
Text2 0, 0, mkr_id</description>
      <pubDate>Wed, 25 Jan 2006 17:49:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16378#M34684</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-01-25T17:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16379#M34685</link>
      <description>&lt;BLOCKQUOTE&gt;Weston wrote:&lt;BR /&gt;yeah, I agree - but I have yet to be able to get a graphical  hotspot to work, even following the GDL manual.  I'll try grabbing code from another part, perhaps.  &lt;BR /&gt;
&lt;BR /&gt;
Wouldn't I still want to get the text in the right spot (using gdl) to begin with?  I'm trying to reduce the work people have to do - if they have to enter text and then drag it around everytime, they might as well just use an actual text element. I agree that having it movable is good so one could account for oddities in the plan - it just has to start in the "right" place by default.&lt;/BLOCKQUOTE&gt;

Try this:
&lt;PRE&gt;	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	

	TEXT2		txtA, txtB, subText&lt;/PRE&gt;

I am the Hotspot King... I have graphic hotspots in so many places my staff complains about anything that does not have them....</description>
      <pubDate>Wed, 25 Jan 2006 18:05:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16379#M34685</guid>
      <dc:creator>TomWaltz</dc:creator>
      <dc:date>2006-01-25T18:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16380#M34686</link>
      <description>&lt;BLOCKQUOTE&gt;F. wrote:&lt;BR /&gt;Without testing it, but the DEFINE defines the style. The STYLE sets the style. If you want to measure the text, you have to set the style before!&lt;/BLOCKQUOTE&gt;

DUH...  Thanks, FB.  &lt;BR /&gt;
&lt;BR /&gt;
Now I can try to tackle the rotation and the graphical hotspot.</description>
      <pubDate>Wed, 25 Jan 2006 18:21:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16380#M34686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-25T18:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16381#M34687</link>
      <description>&lt;BLOCKQUOTE&gt;TomWaltz wrote:&lt;BR /&gt;Try this:
&lt;PRE&gt;	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	

	TEXT2		txtA, txtB, subText&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

so how does this work? check script gives me "txtA isn't a valid parameter name". Do I have to define those variables somewhere first?</description>
      <pubDate>Wed, 25 Jan 2006 19:39:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16381#M34687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-25T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16382#M34688</link>
      <description>They have to be part of the parameter list. They are the coordinates of the text.
&lt;PRE&gt;DEFINE Style txt "Arial", txt_sz, 5, 0
SET STYLE txt
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
rot2 90

! Y-direction
HOTSPOT2 txtA, 0,       4, txtB, 1+128
HOTSPOT2 txtA, -1,       5, txtB, 3
HOTSPOT2 txtA, txtB,    6, txtB, 2
 
! X-direction
HOTSPOT2 0, txtB,       7, txtA, 1+128
HOTSPOT2 -1, txtB,       8, txtA, 3
HOTSPOT2 txtA, txtB,      9, txtA, 2   

TEXT2 txtA, txtB, mkr_id&lt;/PRE&gt;

This should work and give you a hint.</description>
      <pubDate>Wed, 25 Jan 2006 21:26:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16382#M34688</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-01-25T21:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16383#M34689</link>
      <description>OK!  made some progress!&lt;BR /&gt;
&lt;BR /&gt;
I have the part working with fixed text from the proper origin, or with the movable hotspot starting at 0,0, but I can't get the code above to move the default origin and then let the user modify the hotspot.  The spot is green as if the program would let me move it, but the pet pallette does not give me the option.&lt;BR /&gt;
&lt;BR /&gt;
 Any thoughts?  Thanks for the help so far!&lt;BR /&gt;
&lt;BR /&gt;
Wes</description>
      <pubDate>Thu, 26 Jan 2006 14:15:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16383#M34689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-26T14:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16384#M34690</link>
      <description>Can you post or mail your actual code?</description>
      <pubDate>Thu, 26 Jan 2006 15:28:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16384#M34690</guid>
      <dc:creator>Frank Beister</dc:creator>
      <dc:date>2006-01-26T15:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: controlling text rotation</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16385#M34691</link>
      <description>sure - why not...
&lt;PRE&gt;!!!!!!!!!!!!!!!!!!!!!!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~ &amp;lt;= 	224	THEN rot_adj=180+mir_adj
IF W~ &amp;gt;		224	THEN rot_adj=0+mir_adj
IF W~ &amp;lt;		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&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2006 16:00:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/controlling-text-rotation/m-p/16385#M34691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-01-26T16:00:06Z</dc:date>
    </item>
  </channel>
</rss>

