Results 1 to 7 of 7

Thread: Adding a Dotted Pair Into a Entity Definition Data

  1. #1
    I could stop if I wanted to Kevin Janik's Avatar
    Join Date
    2003-05
    Location
    Portland, OR
    Posts
    383
    Login to Give a bone
    0

    Default Adding a Dotted Pair Into a Entity Definition Data

    I am trying to revise an attribute to have a revised color. Since the existing entity color is "Bylayer" there is no (62 . __) dotted pair in the entity definition data as you can see below. I was hoping to substitue for the list (62 . __) dotted pair but that will not work when it is not there. Please advise on what I can do without remaking the entity from scratch.

    Thanks in advance.

    Kevin

    ((-1 . <Entity name: 7ec9daf8>) (0 . "ATTRIB") (330 . <Entity
    name: 7ec9daf0>) (5 . "16EF") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8
    . "0") (100 . "AcDbText") (10 5.14048 5.58191 0.0) (40 . 0.1) (1 . "asdfasf")
    (50 . 0.0) (41 . 0.9) (51 . 0.0) (7 . "ROMANS") (71 . 0) (72 . 1) (11 5.38905
    5.63191 0.0) (210 0.0 0.0 1.0) (100 . "AcDbAttribute") (2 . "###") (70 . 0) (73
    . 0) (74 . 2))

  2. #2
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Adding a Dotted Pair Into a Entity Definition Data

    Quote Originally Posted by Kevin Janik
    I am trying to revise an attribute to have a revised color. Since the existing entity color is "Bylayer" there is no (62 . __) dotted pair in the entity definition data as you can see below. I was hoping to substitue for the list (62 . __) dotted pair but that will not work when it is not there. Please advise on what I can do without remaking the entity from scratch.
    Use append to tack on additional info like this:

    Code:
       (setq entlist (append entlist '((62 . __))))
       (entmod entlist)
    Simon

  3. #3
    I could stop if I wanted to Kevin Janik's Avatar
    Join Date
    2003-05
    Location
    Portland, OR
    Posts
    383
    Login to Give a bone
    0

    Default Re: Adding a Dotted Pair Into a Entity Definition Data

    I tried that but when I updated the entity it did not work. I first added to the list the color red using "(list (cons 62 1))" Then I substitued the color I wanted after that into the definition data list. "(setq ATC:EL (subst (cons 62 ATC:NEWVAL)(assoc 62 ATC:EL) ATC:EL))" and then (entmod ATC:EL) and then updated the block entity using the entity name (entupd ATC:ATT). No color changed and entity definition list seemed to never add the (62. 1) dotted pair at all.

    Do you have an example that works?

  4. #4
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Adding a Dotted Pair Into a Entity Definition Data

    Yup. Just threw it together and tested it out.
    Code:
    (defun c:chcolor ()
        (setq ent (car (entsel))
      		  entlist (entget ent)
        );setq
        (if
      	(assoc 62 entlist)
      	(setq entlist (subst '(62 . 10) (assoc 62 entlist) entlist))
      	(setq entlist (append entlist '((62 . 10))))
        );if
        (entmod entlist)
      )

  5. #5
    I could stop if I wanted to Kevin Janik's Avatar
    Join Date
    2003-05
    Location
    Portland, OR
    Posts
    383
    Login to Give a bone
    0

    Smile Re: Adding a Dotted Pair Into a Entity Definition Data

    Thank you! That did work. I think when I was playing around I forgot to store the value and therefore I thought it did not work.

    Kevin

  6. #6
    I could stop if I wanted to scwegner's Avatar
    Join Date
    2004-12
    Location
    Minneapolis, MN
    Posts
    449
    Login to Give a bone
    0

    Default Re: Adding a Dotted Pair Into a Entity Definition Data

    Quote Originally Posted by Kevin Janik
    Thank you! That did work. I think when I was playing around I forgot to store the value and therefore I thought it did not work.

    Kevin
    Oops. That would do it alright. I always wonder how many great programing ideas I've abandoned because of typos when testing. Happy to help.

    Simon

  7. #7
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Adding a Dotted Pair Into a Entity Definition Data

    Instead of using entity lists to append the 62 dxf code it is much easier to use activeX

    (vl-load-com)
    (setq objSelection (vlax-ename->vla-object (car (entsel))))
    (vla-put-color objSelection 1)

    Peter Jamtgaard

Similar Threads

  1. Getting subentity data from entity. . .
    By M. Kubitza in forum AutoLISP
    Replies: 4
    Last Post: 2009-06-06, 11:26 AM
  2. Replies: 0
    Last Post: 2009-04-15, 02:42 PM
  3. Object data from entity to FDO Feature data property
    By vlee in forum AutoCAD Map 3D - Data Connect (FDO)
    Replies: 3
    Last Post: 2009-04-09, 04:59 PM
  4. Removing a dotted pair
    By Shoey in forum AutoLISP
    Replies: 4
    Last Post: 2007-09-21, 02:10 PM
  5. Adding an existing entity into a block
    By rajat126 in forum AutoLISP
    Replies: 1
    Last Post: 2004-08-16, 09:13 AM

Posting Permissions

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