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

XREF only if not already Xrefed

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
118 Views, 2 Replies

XREF only if not already Xrefed

I've created a batch which xrefs drawings throughout an entire directory.

The problem that I've run into is that the drawing is xrefed every time,
whether it is already included in the drawing or not, therefore creating a
duplicate entity in the field of the drawing.

Does anyone have any solutions for this problem?

Or can someone tell me how I can get a list of all files that are xrefed in
a drawing. I need a batch process for this as we have over 100 drawings in
every folder.

As always, thanks for your help.

Joe C.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Joseph Christou wrote:

>I've created a batch which xrefs drawings throughout an entire directory.
>
>The problem that I've run into is that the drawing is xrefed every time,
>whether it is already included in the drawing or not, therefore creating a
>duplicate entity in the field of the drawing.
>
>Does anyone have any solutions for this problem?
>
>Or can someone tell me how I can get a list of all files that are xrefed in
>a drawing. I need a batch process for this as we have over 100 drawings in
>every folder.
>
>As always, thanks for your help.
>
>Joe C.
>
>
>
>
Or insert if not already inserted, would be good too. I could use both.
as checks for inserting.

bobb
Message 3 of 3
Anonymous
in reply to: Anonymous

To get the list of xref's in the current drawing, try the following (you'll
have to look up one piece of information).

You may also need to check the parenthesis counts as this is just a rought
first draft.

(setq Block(tblnext "Block" 1));Start from the first block
(if (=(car(assoc 70 block)) 4);not positive whether this should be a "CAR"
or a "CDR"--if there are errors change the car to cdr here and below
(setq xr(list (strcase(car(assoc 3 block)))))
)
(while (setq block(tblnext "block")))
(setq Block(tblnext "Block"));Start from the next block
(if (=(car(assoc 70 block)) 4);not positive whether this should be a "CAR"
or a "CDR"--if there are errors change the car to cdr here and below
(if xr
(setq xr (append xr (setq xr(list (strcase(car(assoc 3 block))))))
(setq xr(list (strcase(car(assoc 3 block)))))
)
)
)

Once you have this list you can compare it to the file you want to attach:

;not sure of the proper order of the "member" function below. I think it's
(member list value).
(if (not (member xr (strcase file)))(command "xref" "a" file InsertionPt
scale rotation))

--

RDI

(remove the exclamation from the email address)

"Joseph Christou" wrote in message
news:B70EF1C4B16D4D2EB5E33E045B591BF6@in.WebX.maYIadrTaRb...
> I've created a batch which xrefs drawings throughout an entire directory.
>
> The problem that I've run into is that the drawing is xrefed every time,
> whether it is already included in the drawing or not, therefore creating a
> duplicate entity in the field of the drawing.
>
> Does anyone have any solutions for this problem?
>
> Or can someone tell me how I can get a list of all files that are xrefed
in
> a drawing. I need a batch process for this as we have over 100 drawings in
> every folder.
>
> As always, thanks for your help.
>
> Joe C.
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost