+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Jan 2007
    Posts
    159

    Default Blocks: disappear and reset color

    Registered forum members do not see this ad.

    Hi folks, i'm having a bit of trouble with blocks wondered if anyone could shed some light on the issues.

    When i create a block through autolisp two things happen,

    first: The block disappears and i have to insert it back into the drawing

    second: The colors that i have set the inidividual entites within the block are reset to bylayer.

    Worth noting i've just noticed that if you set the colour of new entities to anything other than by layer the colours come in as desired

    With that said is there a way to set that at te begining and reset it after the lisp program finishes

    Thanks,
    Ollie.

  2. #2
    Senior Member uddfl's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Posts
    312

    Default

    You can setq a variable for the insertion point and have the block inserted at that point once the block is created.

    I am not sure I understand the part about the colors. how do you know that the entities' color changed? Are you exploding the block and then listing the entities / using xlist , or is it just a visual change?
    "AS IS" AND WITH ALL FAULTS.

  3. #3
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    When i create a block through autolisp two things happen...
    How you make it? I know at least 5 ways of creation of the block by AutoLISP but not one of them does not change colour of entities after it. If it not a secret code protected by FBI please publish it.

  4. #4
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Jan 2007
    Posts
    159

    Default

    Sorry that wasn't very well explained. The individual entities are being created using polar positioned points each entity is set to the appropriate color through entmod. The entities are added to a selection set and the items in the set are then turned into a block. The a counter is set when the lisp file is loaded to ensure that the name of the block is unique..

    All the entities on the block appear white when the block is inserted and changing the color manually afterwards has no effect.

  5. #5
    Senior Member uddfl's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2008
    Posts
    312

    Default

    Quote Originally Posted by ollie View Post
    Sorry that wasn't very well explained. The individual entities are being created using polar positioned points each entity is set to the appropriate color through entmod. The entities are added to a selection set and the items in the set are then turned into a block. The a counter is set when the lisp file is loaded to ensure that the name of the block is unique..

    All the entities on the block appear white when the block is inserted and changing the color manually afterwards has no effect.
    Post the function, there might be a bug in it.
    "AS IS" AND WITH ALL FAULTS.

  6. #6
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Jan 2007
    Posts
    159

    Default

    Registered forum members do not see this ad.

    I found the sytem variable i was looking for: "cecolor" lets you set the default color putting this in fixed the issue.

Similar Threads

  1. reset blocks within blocks to layer 0
    By ged in forum AutoLISP, Visual LISP & DCL
    Replies: 23
    Last Post: 29th Aug 2008, 06:31 am
  2. how to change a layer color in a block made out several blocks
    By firsrate_caduser in forum AutoCAD General
    Replies: 6
    Last Post: 16th Nov 2006, 06:25 pm
  3. Color faces,color edges commands
    By Lazarus in forum AutoCAD General
    Replies: 2
    Last Post: 31st Jul 2006, 08:44 pm
  4. Color of Blocks
    By WannaBeCader in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 14th Dec 2004, 09:27 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