Reg: XREF send command

Reg: XREF send command

Anonymous
Not applicable
1,491 Views
4 Replies
Message 1 of 5

Reg: XREF send command

Anonymous
Not applicable

Can I know How to use XREF using Send command ,I m using only Interop here

doc.SendCommand("XATTACH" + " " + Fname + " " + " " + "0,0,0" +" "); but its not working can anyone help me out.

0 Likes
Accepted solutions (2)
1,492 Views
4 Replies
Replies (4)
Message 2 of 5

Norman_Yuan
Mentor
Mentor
Accepted solution

"It does not work" does not provide much information about what exactly your issue is. Any error message, how do you call AcadDocument.SendCommand() (the code executed before and after the call, which does matter if you HAVE TO use SendCommand())?

 

But, since you use COM Interop, why do you have to use SendCommand() to attach XRef instead of using AcadModelSpace/PaperSpace.AttachExternalReference()?

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 5

Anonymous
Not applicable
Thank U SO MUCH I ACTUALLY DIDNT KNOW AcadModelSpace/PaperSpace.AttachExternalReference this method,Its helpful now
0 Likes
Message 4 of 5

Anonymous
Not applicable

Detach ,we have to use Block table record then only we have to Detach or else any Direct method is there?

0 Likes
Message 5 of 5

Norman_Yuan
Mentor
Mentor
Accepted solution

An Xref is an AcadBlock.

 

So, you loop through ThisDrawing.Blocks collection, search for AcadBlock with IsXref = True. Once you find the targetting AcadBlock (Xref), you can call

 

AcadBlock.Bind/Detach/Reload/Unload()...

Norman Yuan

Drive CAD With Code

EESignature