+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 21
  1. #11
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    57

    Default

    Registered forum members do not see this ad.

    hi All, many thanks
    the only problem i get is that the layer is a bylayer colour, which for us is a nightmare, as on of out CNC machines when reading a DXF file defaults all bylayer colours to white.
    is there a way around this, can the layer have a colour that is not linked to the bylayer ?

    thanks
    jimpcfd

  2. #12
    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,956

    Default

    So, are you saying that the entities from said layer EDGE had the color set as ByLayer and this isn't interpreted well by your CNC? Therefore you want to have the color set directly on entities. I'm afraid there is no way to control that from layer; what you can do instead is after the sketch is done use QSELECT to gather all entities from that layer and fix their color to red. Or, it you are looking to automate this step you can redefine the SAVE command to add the run of a small AutoLISP routine that will perform that fix prior to save.

    Regards,
    Mircea

  3. #13
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    cecolor 1?

  4. #14
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    57

    Default

    many thanks pBe that cracked it
    so what does ce mean then?
    thanks
    jimpcfd

  5. #15
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Quote Originally Posted by jimpcfd View Post
    many thanks pBe that cracked it
    so what does ce mean then?
    thanks
    jimpcfd
    Current Entity Color
    same goes for Linetypes CELTYPE and Lineweights CELWEIGHT and also for Linetype scales CELTSCALE

    All system variables, that you can also include on your acaddoc.lsp

    (setvar 'Cecolor "1")

  6. #16
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Jul 2010
    Posts
    57

    Default

    thanks again pBe, being able to do that in acaddoc.lsp will be very handy.

    thanks
    jmpcfd

  7. #17
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    Quote Originally Posted by jimpcfd View Post
    thanks again pBe, being able to do that in acaddoc.lsp will be very handy.

    thanks
    jmpcfd
    You are welcome.

    Glad I could help

    Cheers

  8. #18
    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,874

    Default

    If your Layers are set up correctly, another option might be to use the following code to set the Colour of all objects to the colour of the Layer on which each resides (not ByLayer):

    Code:
    (defun c:SetColours ( / a c e i l s x )
        (while (setq a (tblnext "LAYER" (null a)))
            (setq l (cons (cons (cdr (assoc 2 a)) (cons 62 (abs (cdr (assoc 62 a))))) l))
        )
        (if (setq s (ssget "_X"))
            (repeat (setq i (sslength s))
                (setq e (entget (ssname s (setq i (1- i))))
                      c (cdr (assoc (cdr (assoc 8 e)) l))
                )
                (if (setq x (assoc 62 e))
                    (entmod (subst c x e))
                    (entmod (append e (list c)))
                )
            )
        )
        (princ)
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

  9. #19
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,640

    Default

    I supposed a reactor would be too much to ask Lee.
    For Entity creation commands: i.e. Line, Polyline....

    Detect current layer color then set it to CECOLOR
    will that be overkill Lee?

  10. #20
    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,874

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by pBe View Post
    I supposed a reactor would be too much to ask Lee.
    For Entity creation commands: i.e. Line, Polyline....

    Detect current layer color then set it to CECOLOR
    will that be overkill Lee?
    Maybe not too much overkill, but certainly very annoying to code since you would have to account for every entity creation command and check the required colour from the current layer, but also allow for when the user changes an entity's layer / colour independently and react on those events too, using perhaps Object Reactors monitoring every entity created... if you want to code it, be my guest
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

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

Similar Threads

  1. can't load acaddoc.lsp in support file search path
    By ahyin in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 10th Oct 2011, 03:26 pm
  2. Create a Layer and move ALL to that Layer
    By VinniB in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 7th Jul 2010, 03:49 pm
  3. Load AutoCAD in VB.NET 'Cannot create ActiveX component.'
    By sanderson in forum .NET, ObjectARX & VBA
    Replies: 14
    Last Post: 4th Jun 2010, 02:52 pm
  4. Replies: 11
    Last Post: 10th Nov 2007, 06:39 pm
  5. Layer Prop's Manager Dialogue box takes ages to load.
    By garycrampton in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 11th Apr 2005, 10:16 am

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