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

Set Color on all Nested Xrefs

22 REPLIES 22
SOLVED
Reply
Message 1 of 23
spm5
1493 Views, 22 Replies

Set Color on all Nested Xrefs

I am pretty sure this can be done but I dont know VLAX commands well enough to do it. 

 

I want to set all the layers on all nested xref's to color 8. Does any know how/if this can be done?

 

Thanks.

22 REPLIES 22
Message 21 of 23
Kent1Cooper
in reply to: Kent1Cooper


@Kent1Cooper wrote:

....

          (not (wcmatch (cdr (assoc 2 (entget item))) "`*D*,`*X*"))

.... 

[The (wcmatch) checking for "`*D*,`*X*" is to determine that an item is not a Dimension or old-style Hatch pattern "block" -- use string "`*D*,`*X*,`*U*" to also ignore anonymous Blocks.]


Overdid it a little -- the *D is only applicable to distinguish Dimensions when stepping through the "block" table [as in the routine I stole some of this code from], not when stepping through the entities in a Block definition [where Dimensions would not be "INSERT" objects].  That line can be:
 

    (not (wcmatch (cdr (assoc 2 (entget item))) "`*X*"))
 

and is only needed at all if you might sometimes encounter old-style Hatch patterns.  If not, you could set the 'found' variable with just this:

 

    (setq found (= (cdr (assoc 0 (entget item))) "INSERT"))

Kent Cooper, AIA
Message 22 of 23
Kent1Cooper
in reply to: Lee_Mac


@Lee_Mac wrote:

@Kent1Cooper wrote:
 

I don't think you have understood my function Kent; ....

 

Your function is checking whether a Block Definition CONTAINS nested Block References.

 

My function is checking whether a Block Reference appears nested within another Reference.

 

Hence, for this task, you can use my function test whether a particular XRef has a nested reference.

....


I did misunderstand -- a semantic issue.  To my mind, the wording "a particular XRef has a nested reference" or "the supplied block name has nested references" means that it "contains" or "includes" one [or more] nested things within it, not that it "appears nested within another Reference" [for which I would use the wording that it is a nested reference].  If it really means the latter, forget anything in my replies based on the former interpretation, but just know that the meaning is not unambiguous.

Kent Cooper, AIA
Message 23 of 23
Lee_Mac
in reply to: Kent1Cooper


@Kent1Cooper wrote:

I did misunderstand -- a semantic issue.  To my mind, the wording "a particular XRef has a nested reference" or "the supplied block name has nested references" means that it "contains" or "includes" one [or more] nested things within it, not that it "appears nested within another Reference" [for which I would use the wording that it is a nested reference].


But using the wording 'is a nested reference' is incorrect, since the block itself is not a reference and furthermore, not all references may be nested.

 

In my opinion, the function description is clear:

 

;; HasNestedReferences-p  -  Lee Mac
;; Returns T if the supplied block name has references
;; which are nested within other block references.

 

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

Post to forums  

Autodesk Design & Make Report

”Boost