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

Determine whether a block has attributes

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
833 Views, 4 Replies

Determine whether a block has attributes

Hi,

Is there a fast and simple way to ditermine whether a block has attributes
or not?

(command "ddatte" enm) generates an error when "enm" has no attributes.

M
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

(setq HAS-ATTS (if (= 2 (cdr (assoc 70 (tblsearch "block" "2")))) "YES"
"NO"))

Needs a few error traps, I'm sure...

--
Sincerely,
Craig P. Black
------------------------------------------------------
A little song, a little dance...
A little seltzer down your pants...


"Marcel Janmaat" wrote in message
news:5748989@discussion.autodesk.com...
Hi,

Is there a fast and simple way to ditermine whether a block has attributes
or not?

(command "ddatte" enm) generates an error when "enm" has no attributes.

M
Message 3 of 5
LCancilla
in reply to: Anonymous

Check for group code 66. Only attributed blocks will have this.

(setq ELIST (entget(car(entsel))))
(if (assoc 66 ELIST)
(princ "\nBlock has Attributes.")
(princ "\nBlock has NO Attributes.")
)
Message 4 of 5
Anonymous
in reply to: Anonymous

Whoops, the block I was testing it on was called "2"... your test will be as
follows:

(setq HAS-ATTS
(if (= 2 (cdr (assoc 70 (tblsearch "block" "enm"))))
"YES"
"NO"
)
)

--
Sincerely,
Craig P. Black
------------------------------------------------------
A little song, a little dance...
A little seltzer down your pants...


"Craig P. Black" wrote in message
news:5749021@discussion.autodesk.com...
(setq HAS-ATTS (if (= 2 (cdr (assoc 70 (tblsearch "block" "2")))) "YES"
"NO"))

Needs a few error traps, I'm sure...

--
Sincerely,
Craig P. Black
------------------------------------------------------
A little song, a little dance...
A little seltzer down your pants...


"Marcel Janmaat" wrote in message
news:5748989@discussion.autodesk.com...
Hi,

Is there a fast and simple way to ditermine whether a block has attributes
or not?

(command "ddatte" enm) generates an error when "enm" has no attributes.

M
Message 5 of 5
Anonymous
in reply to: Anonymous

Thanx 2 all for posting a reply.

I'm sure it wil be usefull 2 me...

"Craig P. Black" schreef in bericht
news:5749144@discussion.autodesk.com...
Whoops, the block I was testing it on was called "2"... your test will be as
follows:

(setq HAS-ATTS
(if (= 2 (cdr (assoc 70 (tblsearch "block" "enm"))))
"YES"
"NO"
)
)

--
Sincerely,
Craig P. Black
------------------------------------------------------
A little song, a little dance...
A little seltzer down your pants...


"Craig P. Black" wrote in message
news:5749021@discussion.autodesk.com...
(setq HAS-ATTS (if (= 2 (cdr (assoc 70 (tblsearch "block" "2")))) "YES"
"NO"))

Needs a few error traps, I'm sure...

--
Sincerely,
Craig P. Black
------------------------------------------------------
A little song, a little dance...
A little seltzer down your pants...


"Marcel Janmaat" wrote in message
news:5748989@discussion.autodesk.com...
Hi,

Is there a fast and simple way to ditermine whether a block has attributes
or not?

(command "ddatte" enm) generates an error when "enm" has no attributes.

M

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

Post to forums  

Autodesk Design & Make Report

”Boost