AutoCAD/For script generation
Expert: Bill DeShawn - 11/17/2010
QuestionQUESTION: I am doing drawing automation. for that i have to prepare 10 layouts drg. so i have taken one basic template which is blank, 10 layouts are separate 10 drawings.
I have prepared script for that. First i am opening first dwg, copying it and closing it then open my basic dwg and pasteclip there first copied dwg and closing it also, again i am opening second dwg, copying it and closing it then open my basic dwg and pasteclip there second copied dwg and closing it also.......etc.
In this way i am doing copy paste 10 times for 10 layouts. For paste_clip i have given fixed insertion points in script. But this is very big script.
I want to reduce this basic dwg open & close.
Is there is any way?????
Thanks,
Jyotsna
--
ANSWER: Jyotsna:
In order to view multiple instances of the same graphical information, it is often advisable to use external referenced drawings (using the _XREF or _XATTACH command). You can manipulate the layers of the referenced drawings with the _LAYER dialog or the _VPLAYER command. You can limit the extents of the referenced drawing with the _XCLIP command. The referenced drawing should be attached in Model Space and a viewport in a Paper Space layout can be created to view the referenced graphics. The scale of the referenced Model space can be manipulated with the _ZOOM command and the XP argument. For example, if the paper space and model space are to be plotted at the same scale, then while the UNLOCKED viewport is active, the _ZOOM command can be used with the 1XP argument. If the Model Space Viewport objects are to be plotted at a scale that is half of what the Paper Space objects are to be plotted, then _ZOOM 0.5xp. After that is done, then immediately switch to paper space, lock the viewport (with _MVIEW or _PROPERTIES)and grip-stretch the viewport to the desired size and/or shape, move it to its desired location. To activate a viewport I recommend double-clicking inside of it. If you double click on the viewport directly, it will maximize the viewport and when you return to paper space, even though your viewport is locked, the scale of the viewport can be thrown off. Then you will have to unlock the viewport and use the _ZOOM command to scale the viewport back to its intended scale. Once the layout is complete, it can be copied 10 times if you desire and you will have 10 sheets with identical information. In order to copy a layout, merely right click on the layout tab, select "Move or Copy", then "Create a copy" and "Move to End". Then you will need to rename each of the tabs appropriately.
Learning the Use of XREFS will help to keep the size of your drawing to reasonable and eliminate the need of duplicating drawing information which causes large file sizes. I am realizing that there is a lot of information in my response, so if you have more questions, feel free to "FOLLOW UP". I will not be available again today for about 10 hours or so, but I'll be able to address your questions when I come back home from work.
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn
---------- FOLLOW-UP ----------
QUESTION: Hello sir,
Actually sir i have tried through design center also, it copies layout settings only, it not takes drawing sketch.
i am doing script for elevator, which has 10 layouts with its specifications. door type, other details......
I have prepared more templates of its every layout like for differnent door types and from that i will copy one layout as per requirement, & through script i have to paste these layouts.
For that i have given insertion points, and at that insertion points i have done layout setting.
So my layout is pasting at that points in model, hence it show layout with its setting automatically.
I have prepared script for that. First i am opening first dwg, copying it and closing it then open my basic dwg
and pasteclip there first copied dwg and closing it also, again i am opening second dwg, copying it and closing it then open my basic dwg
and pasteclip there second copied dwg and closing it also.......etc.
In this way i am doing copy paste 10 times for 10 layouts. For paste_clip i have given fixed insertion points in script. But this is very big script.
I want to reduce this basic dwg open & close.
Thanks & Regards,
Jyotsna
ANSWER: Jyotsna
For the moment, I'm going to address the first sentence: "it not takes drawing sketch".
If you copy a layout from one drawing to another, two things can happen that can cause objects to not display. First, the viewport that you copy is a window into model space. If objects aren't in exactly the same place in model space in the drawing into which you are pasting the layout as they are in the drawing you copied from, they cannot display. Second, it often happens that a copied and pasted viewport has been set to not display. Using the Properties dialog or palette, you can set the viewport to display the objects in Model Space.
Let me know whether or not this helps. Perhaps the ADC method will work, and there is just a small thing you may have not done, and hopefully this resolves that.
Bill DeShawn
http://my.sterling.net/~bdeshawn
---------- FOLLOW-UP ----------
QUESTION: Hello sir,
I can't get that how objects will display? what is setting for this?
please give me command for this, because properties dialog not shows about display.
Jyotsna
AnswerJoytsna:
Have the Properties dialog or palette open.
If objects are placed in the correct position in Model Space (Model Tab), then while in a layout and in paper space, and with the PICKFIRST system variable set to 1 (on), HIGHLIGHT set to 1 (on), preselect the viewport by clicking on it with the cursor,causing the viewport to be highlighted. Then going directly to the Properties dialog or palette, look for "On", and select "Yes". The viewport will now display the corresponding area of Model Space.
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn