A line with linetype bylayer doesn't have a 6 in the dxf code table. Now I can extract the dxf stuff and use subst ( cons etc to modify the table, but the linetype code isn't there?
How do I do this please?
|
A line with linetype bylayer doesn't have a 6 in the dxf code table. Now I can extract the dxf stuff and use subst ( cons etc to modify the table, but the linetype code isn't there?
How do I do this please?
R.K. McSwain | CAD Panacea |
Code:(setq entlist (entget(car(entsel))) old_dxf (assoc 6 ent_list) new_dxf (cons 6 "Continuous" ) ) (entmod (if old_dxf (subst new_dxf old_dxf ent_list) (append entlist (list new_dxf)) ) ;_ end of if )
R. Robert Bell
Design Technology Manager
Stantec
Opinions expressed are mine alone and do not reflect the views of Stantec.
Try this:
AHCode:(cdr (assoc 6 (tblsearch "LAYER"(cdr (assoc 8 (entget (car (entsel))))))))
To clarify. If any entity has a ByLayer property (Colour or Linetype) then that won't be displayed in an entget list. So if (assoc 6 edata) fails, then you know it has a linetype of bylayer.
Now to find out exactly what linetype it will show, you use abdulhuck's code.
But to modify the line's linetype to something else than "ByLayer", you need to add a 6 group to the edata as per azarko's code.
If by "modify the table" you mean you want to edit the layer's linetype. Then you need to obtain the layer name & use (command ".-Layer" ...). Or get the layer's table entry object and modify it (tip: check abdulhuck's code).
Thats all, azarko that is what I was trying to do, just wasn't able to do it
BTW, that code prints the dxf info to the screen, would
(setvar "cmdecho" 0)
get rid of it?
No need, just add a (princ) to the end of your defun. That's "default" for creating a new command using something like:Otherwise any lisp function returns the last piece of data calculated. And if that is called from the command line it prints this data.Code:(defun C:CommandName (/ entlist old_dxf new_dxf) ;; Copy Code here (princ) ;Ensure last line in function returns nothing )