Author Topic: acModelSpace/acPaperSpace swapped in 2008?!?  (Read 2195 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
acModelSpace/acPaperSpace swapped in 2008?!?
« on: May 09, 2008, 12:54:30 PM »
I'm writing a program that opens a drawing, sets acModelSpace active and then attaches an xref.  However, when I set acModelSpace current, it attaches the xref in Paper Space and if I set acPaperSpace current it attaches an xref in Model Space.

Anyone come across this?

Guest

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #1 on: May 09, 2008, 01:07:43 PM »
*false alarm*

Okay... after some more testing of different profiles/verticals, it would appear that the program I'm writing is somehow geeking the system - not sure how/why though.

Bob Wahr

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #2 on: May 09, 2008, 01:09:32 PM »
Nope.  Want to share any code so's we can play the home version?


Guest

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #3 on: May 09, 2008, 01:22:10 PM »
Nope.  Want to share any code so's we can play the home version?

Have at it.

I'm still messing around with the code to cycle through the drawings to determine what needs to be xrefd and where it needs to go.  Just want to get past this hurdle first.

Any thoughts/comments/suggestions/etc... are greatly appreciated.

Guest

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #4 on: May 09, 2008, 02:55:05 PM »
I see it's been DL'd 4 times.... Someone PLEASE tell me it's happening to you too!  This is driving me up a friggin' wall!  I can't find any reason why MS and PS would be swapped (but just for this program!).


 :realmad:

Jeff_M

  • King Gator
  • Posts: 3944
  • C3D user & customizer
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #5 on: May 09, 2008, 03:06:10 PM »
Just my quick observation.....when opening multiple files you should not continue to use ThisDrawing when operating on them. To be sure you have the correct drawing, always set the drawing being opened to another variable and reference that when doing your operations.

Set NextDwg = Appilcation.Documents.Open("thenextdwg")
NextDwg.ModelSpace.AttachExternalReference ........

That's all I have time for right now, hope it helps.

Guest

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #6 on: May 09, 2008, 03:07:24 PM »
Okay... I've been doing a little house cleaning with this file and came across this that I had in place at one point...

Code: [Select]
Public Enum enumSpace
    acModelSpace
    acPaperSpace
End Enum

And it seems that is the culprit.  But the puzzling thing is that it wasn't being utilized in any way so.... :?


But it looks like all is well in "opposite world" (for now).

Guest

  • Guest
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #7 on: May 09, 2008, 03:08:30 PM »
Just my quick observation.....when opening multiple files you should not continue to use ThisDrawing when operating on them. To be sure you have the correct drawing, always set the drawing being opened to another variable and reference that when doing your operations.

Set NextDwg = Appilcation.Documents.Open("thenextdwg")
NextDwg.ModelSpace.AttachExternalReference ........

That's all I have time for right now, hope it helps.

I have SDI set to 1 so that shouldn't be an issue......right?!?  :?

Jeff_M

  • King Gator
  • Posts: 3944
  • C3D user & customizer
Re: acModelSpace/acPaperSpace swapped in 2008?!?
« Reply #8 on: May 09, 2008, 03:11:03 PM »
And it seems that is the culprit.  But the puzzling thing is that it wasn't being utilized in any way so.... :?
Possibly because the AutoCAD ActiveX API already includes those as Constants for the ActiveSpace property?