Jump to content

Help with Line Types


Recommended Posts

Hi

So I am having dramas with Line types displaying in autocad PERIOD.

 

Nothing will display in model space or paper space at all.

I have tried messing around for quite some time with msltscale ltscale etc etc. I have done my best googling the www and found nothing that assists or helps me.

Someone please help me..

PS I am in metric not imperial

Thankyou for any assistance in advanced

D

Link to comment
Share on other sites

Welcome to the Forum, Dawf85!

 

So, are you saying that dashed lines appear as continuous? You stated that your sketch is in metric units, so you should load the linetypes definitions from acadiso.lin. If by any chance were loaded from acad.lin then please set LTSCALE system variable to at least 25.

If this doesn't help, then please attach the trouble-maker drawing here for someone to take a look to it.

Link to comment
Share on other sites

One more bit of information would be useful.

 

You say that you are using metric units. Are you working with metres, decimetres, centimetres or millimetres? And have you started with a metric template?

 

It does make a difference to what global linetype scale factor to set.

Link to comment
Share on other sites

Thank you for your replies

Msasu

"So, are you saying that dashed lines appear as continuous? You stated that your sketch is in metric units, so you should load the linetypes definitions from acadiso.lin. If by any chance were loaded from acad.lin then please set LTSCALE system variable to at least 25."

My line types did come from acadiso and I deleted and then re-imported to be sure to be sure. Yes all lines no matter what line type I select display as continuous. I have tried changing line scales and all sorts still nothing. I tried changing LTSCALE to different variables including 25 and nothing

Eldon

I am working in metric with meters, everything is drawn in model space and then I apply my company title block etc in paper space, all of which is in meters. I do have a feeling that maybe something is up though I was messing around with some paper sizes etc today and was getting some bizzare results

 

Thankyou

D

Link to comment
Share on other sites

If you delve into the linetype definitions, you will see what the pattern repeat dimension is.

 

With the linetype from acad.lin, the repeat dimension is about 1. With the linetype from acadiso.lin, the repeat dimension is about 25.

 

With this in mind, if you are using metre units and acadiso.lin linetypes, then you should start off with a linetype scalefactor of 0.05. have a look at the spacing and then fine tune it to suit.

 

If you are using millimetre units, then start off with a scale factor of 50, and then fine tune to suit.

 

I actually always draw in metres and generally output to 1 in 200 scale and find that the acad.lin linetypes (i.e. imperial) are fine with a scale factor of 1.

Dashed.PNG

Link to comment
Share on other sites

Thank you all for the assistance so far.

So even though I did this originally I tried again this morning and it worked, that is just starting a new job from the ISO template and adding a line and changing the style. Also bought in my dwt and the line styles remained.

So i think maybe it's in the program I am creating the dwg from (12D)

But I don't know why or what, I have attached a drawing where the problem exists, if someone could have a look and see if they can work out what is going on it would be greatly appreciated.

Thanks

D:)

Test DAWF.dwg

Link to comment
Share on other sites

Ok question 1 are you sure its from 12D it looks like a Civilcad output file. the give away is the linetype "Solid" note thois exists twice depending on version with s or S.

 

Big answer here I have spent years with Civilcad and a bit of time on removing the link for the need to use the generated shx file basicly you substitute a line type from civilcad with a Autocad line type this removes the need for a shx link handy when forwarding on to others. I have also played with the export function removing the point_cross, create a 3d Autocad Point and bring line work back to 2d. Have a look at the lisp below where it talks about line types, these are retrieved from our custom line type file "Custom.lin" Our first attempos were a problem we had a "DOT" linetype and it would take 5 mins for the dwg to open as it made dots at 0.00001 interval we got the surveyors to change. I am happy to help as the program will need to be customised.

 

I got the fence linetype to work at 0.001 but with out the F or / which is in the shx file using my method a LTscale 0f 0.25 is usually good I think we are using imperial.lin. Fence ------ F ----- or ------/-------

 


; convert civilcad to autocad
;;; some code By Jimmy Bergmark
;;; Copyright (C) 1997-2006 JTB World, All Rights Reserved
;;; Website: [url="http://www.jtbworld.com"]www.jtbworld.com[/url]
;;; E-mail: [email="info@jtbworld.com"]info@jtbworld.com[/email]
;;Modified by AH 2012-14
(vl-load-com)
(setq acadapplic (vlax-get-acad-object))
(vla-ZoomExtents acadapplic )
(vla-ZoomScaled acadapplic 0.8 acZoomScaledRelative)
(setq minxy (getvar "extmin"))
(setq maxxy (getvar "extmax"))
(setq maxx (car maxxy))
(setq maxy (cadr maxxy))
(setq minx (car minxy))
(setq miny (cadr minxy))
(setq diffx (- maxx minx))
(setq diffy (- maxy miny))

(setq pt1 (list (+ diffx (+ minx 1000.0)) miny))
(setq pt2 (list (+ diffx (car pt1)) miny))
(setq pt3 (list (car pt2) maxy))
(setq pt4 (list (car pt1) maxy))

(setq ss (ssget "X" (list (cons 0 "Point"))))
(command "move" ss "" minxy pt1)
(command "layer" "off" "DTM-*" "")
(setq ss2 (ssget "W" minxy maxxy))
; zero.lsp must be loaded 1st to work
(princ "\nZero now running")
(setq g ss2)
(circ0)
(line0)
(arc0)
(sol0)
(text0)
(pt0)
(dim0)
(pline0)
(lwpline0)
(ins0)
(command "move" ss "" pt1 minxy)
(command "layer" "on" "DTM-*" "")
(princ "\nall done")
(setq  doc (vla-get-activedocument acadapplic)) ; open database
; converts civilcad blocks to bylayer proerties 
 (vlax-for block (vla-get-blocks doc) 
   (if   (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) 
     (vlax-for   ent block 
  (vla-put-color ent 0) 
  (vla-put-linetype ent "Bylayer") 
  (vla-put-lineweight ent aclnwtbyblock) 
  ) ;_ end of vlax-for 
     ) ;_ end of if 
   ) ;_ end of vlax-for 
 (vla-regen doc acactiveviewport) 
(Alert "Solid line in blocks removed")

(defun loadLinetype (doc LineTypeName FileName)
 (if (and
       (not (existLinetype doc LineTypeName))
       (vl-catch-all-error-p
         (vl-catch-all-apply
           'vla-load
           (list
             (vla-get-Linetypes doc)
             LineTypeName
             FileName
           )
         )
       )
     )
   nil
   T
 )
)
(defun existLinetype (doc LineTypeName / item loaded)
 (vlax-for item (vla-get-linetypes doc)
   (if (= (strcase (vla-get-name item)) (strcase LineTypeName))
     (setq loaded T)
   )
 )
)
;load missing linetypes
;;; returns: T if loaded else nil
(loadLinetype doc "Fence" "custom.lin")
(loadLinetype doc "Tree" "custom.lin")
(loadLinetype doc "Water_main" "custom.lin")
(loadLinetype doc "Gas_main"  "custom.lin")
(loadLinetype doc "Sewer_main" "custom.lin")
(loadLinetype doc "Dashed2" "custom.lin")
(loadLinetype doc "Dashed" "custom.lin")
(loadLinetype doc "Center" "custom.lin")
(loadLinetype doc "Batter" "custom.lin")
(loadLinetype doc "Batterup" "custom.lin")
(Alert "Line types loaded")
(setq layer (vla-get-layers doc))
(vlax-for each layer
 (setq ltype (vla-get-linetype each))
 (If (or (= Ltype  "solid" )(= ltype "SOLID"))
   (vla-put-linetype each "Continuous")
 )
 (If (= Ltype  "dash" )
   (vla-put-linetype each "DASHED")
 )
 (If (= Ltype  "903" )
   (vla-put-linetype each "FENCE")
 )
 (If (= Ltype  "VEGETATION" )
   (vla-put-linetype each "TREE")
 )
) ; end for
(Alert "Layer line types changed")
(setq ssall (ssget "x"))
(setq x 0)
(repeat (sslength ssall)
(setq obj (vlax-ename->vla-object (ssname ssall x)))
(vlax-put-property obj "Linetype" "Bylayer") 
;(vlax-put-property obj "Lineweight" acbylayer)
(vlax-put-property obj "Color" acbylayer)
(vlax-release-object obj)
(setq x (+ x 1))
) ; end repeat
(Alert "All objects now by layer")
(setq ssccad (ssget "_x" '((0  . "INSERT"))))
(setq sscadlen (sslength ssccad))
(setq x 0)
(repeat sscadlen
(setq obj (vlax-ename->vla-object (ssname ssccad x))) 
(setq val (vla-get-name obj))
(if (or (= val "POINT_CROSS" )(= val  "CCAD_POINT_CROSS"))
   (vla-delete obj)
) ;end if
(setq x (+ x 1))
)
(setq ssccad nil
      sscadlen nil)
(Alert "All CCAD Point blocks gone")
; convert layers now
; convert layers now
(setq xxt 1)
(setq fname (open "S:\\Autodesk\\lisp\\civilcad6layercodes.txt" "r"))
(while (setq layercode (read-line fname))
(setq  J  22)
(setq ans " ")
(While (= ans " ") 
(setq ans (substr layercode J 1))
(setq j (- j 1))
) ;end while
 
(setq Lname (substr layercode 1 (+ 1 J)))
 
(setq Laycol (substr layercode 23 1)) ; color is only 1 character
(setq  J  35)
(setq ans " ")
(While (= ans " ") 
(setq ans (substr layercode J 1))
(setq j (- j 1))
) ;end while
(setq j (- (+ j 2) 25))
(setq Laylt (substr layercode 25 J))
(princ xxt)
(vlax-for each layer  
(if (= lname  (vla-get-name each))
   (progn
   (vla-put-linetype each laylt)
   (vla-put-color each laycol)
   ) ;progn
) ; if
); for
(setq xxt (+ xxt 1))
) ;end file while
(close fname)
(alert "Layer Linetypes changed")
(command "zoom" "e")
(command "-purge" "all" "*" "N")
(command "-purge" "all" "*" "N")
(princ)

 

;ZERO needs to be loaded 1st
; changes all level to zero
(defun dxf(code elist)
(cdr (assoc code elist))
)
(defun circ0 (/ g n lg e os ns el nl)
(princ "\nChanging CIRCLES: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "CIRCLE"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun line0 (/ g n lg e os ns of nf el nl)
(princ "\nChanging LINES: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "LINE"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq of (assoc 11 e))
(setq nf (list(car of)(cadr of)(caddr of) 0.0))
(setq e (subst nf of e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun arc0 (/ g n lg e os ns el nl)
(princ "\nChanging ARCS: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "ARC"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
) 
(defun sol0 (/ g n lg e o1 n1 o2 n2 o3 n3 o4 n4 el nl)
(princ "\nChanging SOLIDS:" )
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "SOLID"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq o1 (assoc 10 e))
(setq n1 (list(car o1)(cadr o1)(caddr o1) 0.0))
(setq e (subst n1 o1 e))
(setq o2 (assoc 11 e))
(setq n2 (list(car o2)(cadr o2)(caddr o2) 0.0))
(setq e (subst n2 o2 e))
        (setq o3 (assoc 12 e))
(setq n3 (list(car o3)(cadr o3)(caddr o3) 0.0))
(setq e (subst n3 o3 e))
        (setq o4 (assoc 13 e))
(setq n4 (list(car o4)(cadr o4)(caddr o4) 0.0))
(setq e (subst n4 o4 e))
        (setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun text0 (/ g n lg e os ns of nf el nl)
(princ "\nChanging TEXT: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "TEXT"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
        (setq of (assoc 11 e))
(setq nf (list(car of)(cadr of)(caddr of) 0.0))
(setq e (subst nf of e))
        (setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun pt0 (/ g n lg e os el nl)
(princ "\nChanging POINTS: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "POINT"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
        (setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun dim0 (/ g n lg e o1 n1 o2 n2 o3 n3 o4 n4 o5 n5 o6 n6 o7 n7 el nl)
(princ "\nChanging DIMS: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "DIMENSION"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq o1 (assoc 10 e))
(setq n1 (list(car o1)(cadr o1)(caddr o1) 0.0))
(setq e (subst n1 o1 e))
(setq o2 (assoc 11 e))
(setq n2 (list(car o2)(cadr o2)(caddr o2) 0.0))
(setq e (subst n2 o2 e))
        (setq o3 (assoc 12 e))
(setq n3 (list(car o3)(cadr o3)(caddr o3) 0.0))
(setq e (subst n3 o3 e))
        (setq o4 (assoc 13 e))
(setq n4 (list(car o4)(cadr o4)(caddr o4) 0.0))
(setq e (subst n4 o4 e))
(setq o5 (assoc 14 e))
(setq n5 (list(car o5)(cadr o5)(caddr o5) 0.0))
(setq e (subst n5 o5 e))
        (setq o6 (assoc 15 e))
(setq n6 (list(car o6)(cadr o6)(caddr o6) 0.0))
(setq e (subst n6 o6 e))
        (setq o7 (assoc 16 e))
(setq n7 (list(car o7)(cadr o7)(caddr o7) 0.0))
(setq e (subst n7 o7 e))
        (setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun pline0 (/ g n lg e os ns el nl ed en)
(princ "\nChanging PLINES and DONUTS: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "POLYLINE"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
(SETQ en (DXF -1 e)) 
(while (and (setq en (entnext en))
(SETQ ED (ENTGET EN))
(/= "SEQEND" (dxf 0 ed))
)
(progn
(setq os (assoc 10 ed))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq ed (subst ns os ed))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod ed)
)
)
(entupd en)
)
)
(setq n (1+ n))
)
))
)
(defun lwpline0 (/ g n lg e os ns el nl ed en)
(princ "\nChanging LWPLINES ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "LWPOLYLINE"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
(SETQ en (DXF -1 e)) 
(while (and (setq en (entnext en))
(SETQ ED (ENTGET EN))
(/= "SEQEND" (dxf 0 ed))
)
(progn
(setq os (assoc 10 ed))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq ed (subst ns os ed))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod ed)
)
)
(entupd en)
)
)
(setq n (1+ n))
)
))
)

(defun ins0 (/ g n lg e os ns el nl)
(princ "\nChanging BLOCK INSERTS: ")
(setq g (ssget "P"))
(if g (progn
(setq n 0 lg (sslength g))
(while (< n lg)
(if (= "INSERT"
(cdr (assoc 0 (setq e (entget (ssname g n))))))
(progn
(setq os (assoc 10 e))
(setq ns (list(car os)(cadr os)(caddr os) 0.0))
(setq e (subst ns os e))
(setq el (assoc 38 e))
(setq nl (cons 38 0.0))
(setq e (subst nl el e))
(entmod e)
)
)
(setq n (1+ n))
)
))
)
(defun c:zero ()
(setq g (ssget))
(circ0)
(line0)
(arc0)
(sol0)
(text0)
(pt0)
(dim0)
(pline0)
(lwpline0)
(ins0)
(princ)
)

Link to comment
Share on other sites

BigAl,

Thanks for the info.

Hahaha nice find on that, Yes it is coming from 12D but my DWT is from a previous company that used civil cad and had the line styles where all setup in the dwt for civilcad specifically. I just modified it to suite me but there are still somethings I need to fix up which included the default line styles. I have to write a 12d mapping file for export to autocad.

Anyway with that aside I managed to sort it out

I set globalscale factor to 0.5 in LT manager then change the line scale factors to either 0.5 or 0.25 depending on desired results.

Thank you all for your assistance

D

Link to comment
Share on other sites

One other thing that I would check-

 

Its little known but the arc and circle smoothness setting can also affect the display of dashed lines for some reason, look at-

 

Tools->Options ->Display->Display Resolution (Arc and Circle Smoothness)

 

If this is set to 0 or 1 then dashed, dotted, and chain dashed lines will appear solid, it should be set to about 100 or 200 to give smooth circles and curves as well as displaying broken lines correctly.

Link to comment
Share on other sites

One other thing that I would check-

 

Its little known but the arc and circle smoothness setting can also affect the display of dashed lines for some reason, look at-

 

Tools->Options ->Display->Display Resolution (Arc and Circle Smoothness)

 

If this is set to 0 or 1 then dashed, dotted, and chain dashed lines will appear solid, it should be set to about 100 or 200 to give smooth circles and curves as well as displaying broken lines correctly.

 

The default setting is 1000. If I remember correctly, it has been for over ten years. The only reason anyone would set it lower than that is because they have a computer from that era that was severely lacking on graphics hardware back then. Computers these days can easily handle a setting of 10,000.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...