TheSwamp

Code Red => VB(A) => Topic started by: Bashworth on January 26, 2015, 03:53:34 PM

Title: AttachXref going into wrong space
Post by: Bashworth on January 26, 2015, 03:53:34 PM
Ok, maybe it's something as easy as the cold medicine making me miss something, but I'm drawing a blank as to why this isn't working properly.

I have a routine that inserts a series of xrefs.  After a few rounds of seeing nothing show up in model space, I flipped back over to paperspace and zoomed out.  Yep.. there they were.  Inserted into PaperSpace.  They're inserting at the correct insertion point, scale, everything... but they're not going into model space.

So where am I going wrong here?

Set ActiveReference = ThisDrawing.ModelSpace.AttachExternalReference(Block.Path, Block.Name, InsPoint, 1, 1, 1, 0, False)
Title: Re: AttachXref going into wrong space
Post by: David Hall on January 28, 2015, 10:37:03 AM
Hey Ben, long time no talk.  Is there anything else further down in the code that might be moving it?
Title: Re: AttachXref going into wrong space
Post by: Bashworth on February 04, 2015, 02:16:41 PM
No.  Stepped through the SOB, and it just put them all into current space.

Just set ModelSpace as active before inserting the xrefs, and issue is gone.