Author Topic: Linetype needed  (Read 4199 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7533
Linetype needed
« on: March 11, 2010, 10:17:51 AM »
Does anyone know how to make the line type shown below?


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Linetype needed
« Reply #1 on: March 11, 2010, 10:28:34 AM »
you should be able to find/create a similar linetype in acad.lin file

*GAS_LINE,Gas line ----GAS----GAS----GAS----GAS----GAS----GAS--
A,.5,-.2,["GAS",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.25

becomes

*Electric_LINE,Gas line ----E----E----E----E----E----E--
A,.5,-.2,["E",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-.25
« Last Edit: March 11, 2010, 10:34:43 AM by mjfarrell »
Be your Best


Michael Farrell
http://primeservicesglobal.com/

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Linetype needed
« Reply #2 on: March 11, 2010, 10:51:55 AM »
Thanks for the reply Mike. The part that had me confused was the double line in the definition  :|

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

JCTER

  • Guest
Re: Linetype needed
« Reply #3 on: March 11, 2010, 10:57:24 AM »
AFAIK, unless you use some character that's double lined, like the equals sign (=) you cannot have two lines occupying the same space in a line definition.  This is something I kinda hate about Autocad's linetype ability.  There's plenty of stuff that could use updating.

You could use a MULTILINE, but that introduces a lot of complication, error, and inconsistency that come with a utility that is also just as unimpressive as regular linetypes, imo :( :(

If you're comfortable using a custom shape definition, I'd say go that route, but in some environments, that is more hassle than it's worth, maybe yours included.

I've tried to get a similar linetype with parallel 'horizontal' lines, but ended up using multilines, and then I got disgruntled about different problems that multilines had.  It might be a solution for you though.

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Linetype needed
« Reply #4 on: March 11, 2010, 12:02:32 PM »
So other than creating a shape file to use this is not possible?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

JCTER

  • Guest
Re: Linetype needed
« Reply #5 on: March 11, 2010, 12:04:48 PM »
So other than creating a shape file to use this is not possible?

Unless you can find a suitable character that'll work well enough in a font file.  Or you could create a custom font :P

Short of it... no, you'd have to create a custom doohickey of some sort.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Linetype needed
« Reply #6 on: March 11, 2010, 12:58:40 PM »
So other than creating a shape file to use this is not possible?
I tried that once and it looked TERRIBLE.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Linetype needed
« Reply #7 on: March 11, 2010, 01:20:14 PM »
 :|

Code: [Select]
(defun c:TEst (/ w p1 p2 lst obj)
  (and (setq w (getdist "\nSpecify width: "))
       (setq w (/ w 12.))
       (setq p1 (getpoint "\nSpecify first point: "))
       (setq lst (list p1))
       (while (setq p2 (getpoint (car lst) "\nSpecify next point: "))
         (grdraw (car lst) p2 -1)
         (setq lst (cons p2 lst))
       ) ;_ while
       (setq obj (vlax-ename->vla-object
                   (entmakex (append (list '(0 . "LWPOLYLINE")
                                           '(100 . "AcDbEntity")
                                           '(100 . "AcDbPolyline")
                                           (cons 90 (length lst))
                                     ) ;_ list
                                     (mapcar '(lambda (x) (cons 10 x)) lst)
                             ) ;_ append
                   ) ;_ entmakex
                 ) ;_ vlax-ename->vla-object
       ) ;_ setq
       (progn
         (mapcar '(lambda (#) (vl-catch-all-apply 'vla-offset (list obj (/ w #))))
                 '(2. -2.)
         ) ;_ mapcar
         (vla-delete obj)
         (redraw)
       ) ;_ progn
  ) ;_ and
) ;_ defun
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Linetype needed
« Reply #8 on: March 11, 2010, 01:27:06 PM »
What about using an MLINE style?  You could create a simple line style that has dots on each end and the letter 'E' spaced throughout.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Linetype needed
« Reply #9 on: March 11, 2010, 05:45:19 PM »
Thanks for the reply Mike. The part that had me confused was the double line in the definition  :|

Is it REALLY a double line definition, or just TWO different features whose line types are similar lying next to each other in plan view?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Linetype needed
« Reply #10 on: March 11, 2010, 05:56:10 PM »
Thanks for the reply Mike. The part that had me confused was the double line in the definition  :|

Is it REALLY a double line definition, or just TWO different features whose line types are similar lying next to each other in plan view?

It's a linetype in Microstation that I'm trying to mimic.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Linetype needed
« Reply #11 on: March 11, 2010, 06:01:19 PM »
:|

Code: [Select]
(defun c:TEst (/ w p1 p2 lst obj)
  (and (setq w (getdist "\nSpecify width: "))
       (setq w (/ w 12.))
       (setq p1 (getpoint "\nSpecify first point: "))
       (setq lst (list p1))
       (while (setq p2 (getpoint (car lst) "\nSpecify next point: "))
         (grdraw (car lst) p2 -1)
         (setq lst (cons p2 lst))
       ) ;_ while
       (setq obj (vlax-ename->vla-object
                   (entmakex (append (list '(0 . "LWPOLYLINE")
                                           '(100 . "AcDbEntity")
                                           '(100 . "AcDbPolyline")
                                           (cons 90 (length lst))
                                     ) ;_ list
                                     (mapcar '(lambda (x) (cons 10 x)) lst)
                             ) ;_ append
                   ) ;_ entmakex
                 ) ;_ vlax-ename->vla-object
       ) ;_ setq
       (progn
         (mapcar '(lambda (#) (vl-catch-all-apply 'vla-offset (list obj (/ w #))))
                 '(2. -2.)
         ) ;_ mapcar
         (vla-delete obj)
         (redraw)
       ) ;_ progn
  ) ;_ and
) ;_ defun

Thanks for the code Alan .. perhaps if I get bored I'll take it a bit further and plop the E's along it  :lmao:

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Linetype needed
« Reply #12 on: March 11, 2010, 07:32:44 PM »
:|

Code: [Select]
(defun c:TEst (/ w p1 p2 lst obj)
  (and (setq w (getdist "\nSpecify width: "))
       (setq w (/ w 12.))
       (setq p1 (getpoint "\nSpecify first point: "))
       (setq lst (list p1))
       (while (setq p2 (getpoint (car lst) "\nSpecify next point: "))
         (grdraw (car lst) p2 -1)
         (setq lst (cons p2 lst))
       ) ;_ while
       (setq obj (vlax-ename->vla-object
                   (entmakex (append (list '(0 . "LWPOLYLINE")
                                           '(100 . "AcDbEntity")
                                           '(100 . "AcDbPolyline")
                                           (cons 90 (length lst))
                                     ) ;_ list
                                     (mapcar '(lambda (x) (cons 10 x)) lst)
                             ) ;_ append
                   ) ;_ entmakex
                 ) ;_ vlax-ename->vla-object
       ) ;_ setq
       (progn
         (mapcar '(lambda (#) (vl-catch-all-apply 'vla-offset (list obj (/ w #))))
                 '(2. -2.)
         ) ;_ mapcar
         (vla-delete obj)
         (redraw)
       ) ;_ progn
  ) ;_ and
) ;_ defun

Thanks for the code Alan .. perhaps if I get bored I'll take it a bit further and plop the E's along it  :lmao:
Playing around and thought it might help.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

GDF

  • Water Moccasin
  • Posts: 2084
Re: Linetype needed
« Reply #13 on: March 31, 2010, 09:20:40 AM »
or use autocad's dline.lsp routine...
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ronjonp

  • Needs a day job
  • Posts: 7533
Re: Linetype needed
« Reply #14 on: March 31, 2010, 12:03:24 PM »
I ended up using this:

*TRENCH,trench
A,0,-.007898,["E",Standard,y=-.062837,s=.125],-.093018,["=",Standard,y=-.100337,s=.2],-.13344,["=",Standard,y=-.100337,s=.2],-.13344,["=",Standard,y=-.100337,s=.2],-.13181

It's UGLY but works...

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC