+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default want to change linetype color manually ..

    Registered forum members do not see this ad.

    Hi guys.. I AM BACK ..

    I want to change all linetype color manually for printing purpose . Means I want to change all the hidden line of a drawing in red, all continuous in brown ..like this. Now the problem is ..

    1. The code for the linetype is 6 , but whenever the line type is dedicated for a layer, the code 6 is not showing, then how I'll get all the hidden line types (may be in different layers) of a drawing ..

    2. From table search I can get all the line type available in the drawing, but all those line types are in used? I am in doubt .. I failed to find them visually in my drawing ..

    3. I can get the layer name from DXF code 8 , but how can I get the details of the layer, like color, line type etc ..


    Plz help guys ...

    Subho..
    KOlkata..
    India ..

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,922

    Default

    Maybe you can learn from this example:

    Code:
    (defun c:getlinetype ( / dxfdata entity )
        (if (setq entity (car (entsel)))
            (progn
                (setq dxfdata (entget entity))
                (cond
                    (   (cdr (assoc 6 dxfdata)))
                    (   (cdr (assoc 6 (tblsearch "LAYER" (cdr (assoc 8 dxfdata))))))
                )
            )
        )
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  3. #3
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default

    Thnx lee.. thnx a lot ..

    waiting for others reply ...

  4. #4
    Forum Deity Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draftsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electrical.
    Using
    AutoCAD 2014
    Join Date
    Oct 2009
    Location
    Great Syria , Lives in Abu Dhabi
    Posts
    4,025

    Default

    Can you please explain what you looking for straight to the point ?
    - When aim is being settled in my mind , I have to reach it and get it in hand whatever it costs and wherever it is and will never give up . Tharwat said

  5. #5
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,994

    Default

    Quote Originally Posted by nila_joy View Post
    2. From table search I can get all the line type available in the drawing, but all those line types are in used? I am in doubt .. I failed to find them visually in my drawing ..
    There can be 3 cases:
    1. Linetypes attached directly to entities:
    Code:
    (ssget "_X" '((6 . "DOT")))
    2. Linetypes attached by layers - need to check which layers have a linetype other than Continuous; check if those layers are empty or not:
    Code:
    (ssget "_X" (list (cons 8 LayerWithDottedLine)))
    3. Linetypes attached directly to entities inside blocks, a little harder to parse.

    This is for programmatically approach; to visually inspect this just call the PURGE command and check if there are linetypes proposed for remove.

    Quote Originally Posted by nila_joy View Post
    3. I can get the layer name from DXF code 8 , but how can I get the details of the layer, like color, line type etc ..
    To see layer's properties check his record using TBLSEARCH:
    Code:
    (entget (tblsearch "LAYER" "0"))
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  6. #6
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default

    ok, let me explain plainly .. I want to change the colors of the lines of a drawing for printing purpose .. I am writing a program in which all the line types of the drawing will be shown as a list (using DCL) in the left side, and in the right side color box will be shown (already made it by using image DCL) .. user will select one line type from left (like hidden) , assign a color from right (like red) .. and all the hidden lines of the drawing (may be not in same layer ) will be change into red.

    hope I explained what exactly I want to do ..

    Subho..
    Kolkata..
    India ..

  7. #7
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,994

    Default

    Registered forum members do not see this ad.

    Above you have most of the information to list entities by their linetype. To change the color, check the SUBST and ENTMOD functions too.
    The color is stored under DXF code 62, except when is attached per container layer and this code isn’t available. You will have to treat those cases differently.


    I suggest you to start to design the part to gather entities by their linetype and post your attempt here for debug.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

Similar Threads

  1. Replies: 11
    Last Post: 16th Oct 2012, 03:33 pm
  2. Change Bylayer ( color,lineweight,linetype )
    By vnanhvu in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 17th Aug 2011, 05:14 pm
  3. Replies: 4
    Last Post: 18th Jan 2011, 12:06 am
  4. Is it possible to change the color of a linetype?
    By Proctor in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 4th Mar 2010, 12:04 am
  5. Lisp to change all objects with a certain color to another color
    By mikeSIEMENS in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 15th Jan 2010, 04:59 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts