How to Transfer objects from Layout to Model?
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
How to Transfer objects from Layout to Model?

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Stanley
Guest





Posted: Fri Jan 07, 2005 12:14 pm    Post subject: How to Transfer objects from Layout to Model? Reply with quote

Hello everybody,

Let me explain my problem here and wish someone can give some advice about
it.

I make use of Autocad's layout features very often, usually I have about 20
layout pages and each page contains up to 6 viewports in my drawing.

Dimensions / Title Blocks and some other Texts or Marks were all placed on
PaperSpace.

Now I need to transfer every Layout Page into the ModelSpace and save it as
separate drawing files.

The most important thing is to retain the same layout structure, but things
in each viewport must be extracted as entities and placed

into ModelSpace.

Thanks for help.

Best regards.

Stanley.

Back to top
HJohn
Guest





Posted: Sat Jan 08, 2005 12:09 am    Post subject: Re: How to Transfer objects from Layout to Model? Reply with quote

I am not sure if you can accomplish this at all, in an efficient way, but it would be very interesting to see if you can find a way. There is no method to add entities to the model space without providing required parameters, so you would have to create an entity reference (variable) for each entity you have in PS and store their properties. You could then add them to MS, but you still have to figure out the coordinate system relationship between MS and PS. After, you could delete everything from PS. Good luck.
Back to top
Stanley
Guest





Posted: Sat Jan 08, 2005 11:42 am    Post subject: Re: How to Transfer objects from Layout to Model? Reply with quote

Hello John,

Thanks for your advice.

Actually I'm using VBA routine to do the job. The result is acceptable but
slow & seems a bit complex.

My procedures are as follow:
1. Create a new document by VBA code first.
2. Collect all Viewport objects on the LayoutPage.
3. For each Viewport, Get it's Center & Boundary in PS coordinate.
Translate the Center &
Boundary coordinate into MS world coordinate.
Use the translated coordinate as a window for selecting objects
within the Viewport in MS.
4. Copy selected objects from Current Drawing to the New Document.
Move Objects from translated WCS of Viewport's center to the
Viewport's center in PS coordinate.
So that the layout structure can be retained.
5. After all Viewports were processed. Collect all entities on
LayoutPage's PS (except Viewport objects)
and copy them to the New Document also.

The above procedures have been written in VBA and works.
The problem is how to clip the objects that crossed by the Viewport
boundary?
Hope someone can provide a more simple & efficent way to do that.

Back to top
krispy
Guest





Posted: Mon Jan 10, 2005 3:17 am    Post subject: Re: How to Transfer objects from Layout to Model? Reply with quote

Have you looked at using the express tools command CHSPACE which moves objects from paperspace to modelspace and vice versa?
Back to top
Stanley
Guest





Posted: Mon Jan 10, 2005 5:10 am    Post subject: Re: How to Transfer objects from Layout to Model? Reply with quote

Is it available and works with AutoCad2004?
Back to top
Matt W
Guest





Posted: Mon Jan 10, 2005 9:57 pm    Post subject: Re: How to Transfer objects from Layout to Model? Reply with quote

It's part of the Express Tools and yes, it's available in 2004.

--
I support two teams: The Red Sox and whoever beats the Yankees.

"Stanley" <KW_Chan@FengChuan.com.hk> wrote in message
news:41e1c80e_2@newsprd01...
Quote:
Is it available and works with AutoCad2004?

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB