Author Topic: 'Factory' linetype?  (Read 1549 times)

0 Members and 1 Guest are viewing this topic.

craigr

  • Guest
'Factory' linetype?
« on: September 12, 2006, 10:55:34 AM »
I'm trying to create a linetype similar to 'Hot_Water_Supply'

*Factory_LINE,Factory line ----factory----factory----factory----factory----factory----factory--
A,.5,-.2,["Factory",Arial,S=8,R=0.0,X=-0.1,Y=-.05],-.2

I am having a problem getting the word 'factory' to display correctly between the dashes. What am I missing?

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: 'Factory' linetype?
« Reply #1 on: September 12, 2006, 12:43:06 PM »
Hey craigr

Your problem seems to stem from the size of the text that you are using. ( 8 ) and the end of the space (-.2  the last number in the string)

When I make the last number like -38 it seems to show correctly.

Or you can just do this:

*Factory_LINE,Factory line ----factory----factory----factory----factory----factory----factory--
A,.5,-.15,["Factory",Arial,S=.1,R=0.0,X=-0.1,Y=-.05],-.4

Then change the lt scale to get the desired text height.
« Last Edit: September 12, 2006, 01:02:02 PM by TimSpangler »
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright 2016

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: 'Factory' linetype?
« Reply #2 on: September 12, 2006, 01:00:04 PM »
Note that changes to the fixed text height to the style ARIAL will cause unexpected results.

And, if ARIAL isn't loaded, the linetype will fail to load also.

It's a good idea to define all your text based complex linetypes to use the a dedicated textstyle, and then include this textstyle in your template drawing(s).

grush

  • Guest
Re: 'Factory' linetype?
« Reply #3 on: September 13, 2006, 10:26:03 AM »
Code: [Select]
;================================================================================
;D. Marker 10-08-1999
;================================================================================
(defun c:ltxt ()
  (setvar "cmdecho" 0)
  (setq v:clayer (getvar "clayer"))
  (setq v:expert (getvar "expert"))
  (if (not v:linet)
    (setq v:linet "XX")
  ) ;if
  (setq v:linet_x (getstring (strcat "\n \n \nEnter line text: <" v:linet ">")))
  (if (/= v:linet_x "")
    (setq v:linet (strcase v:linet_x))
  ) ;if
  (setq v:linet (strcase v:linet))
  (setvar "expert" 4)
  (setq v:linet_l (strlen v:linet))
  (setq v:linet_w (rtos (* v:linet_l 0.1) 2 1))
  (setq v:lt_file "c:\\temp\\lt_temp.lin")
  (setq v:lt_var1 (open v:lt_file "w"))
  (setq v:lt_textl1 (strcat "*" v:linet "," v:linet "----" v:linet "----" v:linet
                          "----" v:linet
                    ));setq
  (setq v:lt_textl2 (strcat "A,.5,-.2,[" (chr 34) v:linet (chr 34)
                          ",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-" v:linet_w
                    ));setq
  (setq v:lt_var2 (write-line v:lt_textl1 v:lt_var1))
  (setq v:lt_var3 (write-line v:lt_textl2 v:lt_var1))
  (close v:lt_var1)
  (command "-linetype" "l" v:linet v:lt_file "")
  (setvar "expert" v:expert)
  (command ".celtype" v:linet)
  (princ (strcat "\n \n \nCurrent Entity linetype set to:" v:linet))
  (princ)
  (setq v:pnt1 (getpoint "\nPick start point:"))
  (command "pline" v:pnt1)
  (while (setq v:pt (getpoint (getvar "lastpoint")
                            "\nNext point or <Return to terminate>:"
                    ));getpoint, setq
    (command v:pt)
  ) ;while
  (command)
  (command)
  (setvar "celtype" "bylayer")
  (princ)
  (princ "\n \nLine-Text terminated.  Linetype set to BYLAYER:")
  (princ)
) ;defun
(princ)
(princ " Line-Text Loaded...")
(princ)
(princ (strcat "\n \n" (chr 34) "LTXT" (chr 34) " to execute:"))
(princ)


Check that out. I use it all the time. Works good.

Pete