Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

adding a regapp to an existing xdata entry

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
nunleym
513 Views, 5 Replies

adding a regapp to an existing xdata entry

First time posting, just wanted to thank everyone for all the data up here i have usually been able to find what i need without having to ask, but this time i am truely stumped.

 

I am trying to add an additional regapp and data to an entity that already has xdata.

 

(entmod
  (subst (append (assoc -3 (entget #bomitem '("*")))  (list (list "GN_NOTE" '(1002 "{")(cons 1005 (cdr (assoc 5 (entget #last_note_name))))'(1002 "}"))))
  (assoc -3 (entget #bomitem '("*")))
         (entget #bomitem '("*"))
         );subst
  );entmod

 

I keep getting "; error: bad DXF group:" I've tried setting it to a variable and trying entmod also

 

any assistance would be greatly appriciated

 

Thanks in advance for your help!

5 REPLIES 5
Message 2 of 6
hmsilva
in reply to: nunleym


@nunleym wrote:

First time posting, just wanted to thank everyone for all the data up here i have usually been able to find what i need without having to ask, but this time i am truely stumped.

 

I am trying to add an additional regapp and data to an entity that already has xdata.

 


Welcome to the Autodesk Discussion Community, nunleym!

 

If your goal is to add 'an additional regapp' try

 

(regapp "GN_NOTE")
(entmod (append (entget #bomitem) (list (list -3 (list "GN_NOTE" (cons 1005 (cdr (assoc 5 (entget #last_note_name)))))))))

 

Hope that helps

Henrique

EESignature

Message 3 of 6
nunleym
in reply to: hmsilva

Thanks for the reply silva,

 

The result I am looking for is something like this:

 

(-3 ("ITEM" (1002 "{") (1000 . "29336") (1002 "}")) ("GN_NOTE" (1002 "{") (1005 . "8668") (1002 "}")))

 

I am looking to add additional xdata to an entity that already has a regapp and xdata attached.

 

 

Thank you

Message 4 of 6
hmsilva
in reply to: nunleym

Your code, revised...

You did miss two dots..

 

(entmod
  (subst (append (assoc -3 (entget #bomitem '("*")))  (list (list "GN_NOTE" '(1002 . "{")(cons 1005 (cdr (assoc 5 (entget #last_note_name))))'(1002 . "}"))))
  (assoc -3 (entget #bomitem '("*")))
         (entget #bomitem '("*"))
         );subst
  );entmod

 

Hope that helps

Henrique

EESignature

Message 5 of 6
nunleym
in reply to: hmsilva

that was it thank you so much

 

You are the grooviest

 

Thank you

Message 6 of 6
hmsilva
in reply to: nunleym

You're welcome, nunleym
Glad I could help

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost