dbroada Posted May 24, 2013 Share Posted May 24, 2013 I have a "batch plot" routine that creates a script to plot a large number of files which works perfectly well. I am now considering moving this to a VB.Net routine so that it can trap a few more errors than are possible with a script. I'm currently thinking aloud and this may just be a blind alley but one thing has occured to me. At this office, we NEVER use paperspace. However we do occassionaly get drawings from elsewhere that do use paperspace. What I would like is my routine to plot the Modelspace and (maybe optionally) plot the layouts if there is anything worth plotting. My question is how do I decide. I know I can check my block collection for ModelSpace so I assume all layouts will be there too. Would you look for a Lauout with a viewport or a layout with an object? And how would I do that? Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 Download this PDF by Stephen Preston and have a look at page 475 and the subsequent pages. http://www.caddsoftsolutions.com/AutoCAD-.Net-Developers-Guide-Download-PDF.htm Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 Or the online version for AutoCAD 2013 http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-4E1AAFA9-740E-4097-800C-CAED09CDFF12.htm,topicNumber=d30e698475 I'm not sure if it is available as PDF. Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 24, 2013 Author Share Posted May 24, 2013 That is taking an age to open but what I saw was how to print from paperspace. While I will need to know that in the future what I need to know now is how to determine IF it is worth printing from paperspace. While waiting for it to opem, do the following pages answer that? Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 The first part of the section deals in detail with plotting from Model Space with example code for doing it and the last part is a short section on plotting from Paper Space. Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 24, 2013 Author Share Posted May 24, 2013 OK, I'll try again next week. We have a slow network today. Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 I could email it to you, it is a rather small file. Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 24, 2013 Author Share Posted May 24, 2013 I'd be happy with that. Do you still have my address or I shall I pm you? Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 pm me please Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 24, 2013 Author Share Posted May 24, 2013 Thanks tyke. Looks like I should check that a viewport exists within a layout then. I think there is enough info there but its not imediately as straight forward as I had hoped. Never mind, its not pressing just yet. Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 24, 2013 Share Posted May 24, 2013 Thanks tyke. Looks like I should check that a viewport exists within a layout then. I think there is enough info there but its not imediately as straight forward as I had hoped. Never mind, its not pressing just yet. Straight forward is it not, but possible. When you say you only plot from model space do you have empty layouts or no layout tabs at all (I'm not even sure if you can delete all layout tabs! - I just tried it and you must have at least one layout tab). So loop through all the layouts present and check for viewports. Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 24, 2013 Author Share Posted May 24, 2013 I don't have any layout tabs present but that's not to say they're not there. I assume viewports have to be put there, that they don't spontaneously arrive without assistance. Therefore if I can find a viewport I should plot the layout. Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 26, 2013 Share Posted May 26, 2013 You can have a layout without a viewport (although its meaningless), but to plot a drawing in model space from a layout you must have a viewport in that paper space layout. You can also have viewports in model space, so the presence of viewports is no guarantee that there is something plotable on a layout. It is often the case when a drawing is created from a template, that the template has several layout tabs with different size sheets for plotting, but it doesn't mean all or any of the layouts have been configured for this drawing. Sorry for throwing so many problems into the ring, but I really think that you have an enormous task ahead of you. IMHO if these drawings crop up as seldom as you said, I would create a log file and every time you find a file with a layout in paper space, do not plot it but write it's details to the log file and deal with it afterwards manually. Or for these special cases develop a separate module for investigating them and dealing with them. I use log files a lot for controlling events and making it possible for me to keep an eye on what is going on without the user noticing it or even needing to bother about it. Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 26, 2013 Author Share Posted May 26, 2013 I'm more inclined to look at it the other way. I'll check for a viewport in paperspace and plot that. If we start getting too many blank sheets of paper I will have to review the process. However, this is still some time in the future as I have more pressing problems. My retirement could well arrive before I get down to this one seriously. Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 26, 2013 Share Posted May 26, 2013 My retirement could well arrive before I get down to this one seriously. Well document it well because that's a long way in the future and you are a long way behind me in the queue for retirement Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 26, 2013 Author Share Posted May 26, 2013 maybe but I'm more determined Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 26, 2013 Share Posted May 26, 2013 Does that mean you are going to shove in front of me? Quote Link to comment Share on other sites More sharing options...
dbroada Posted May 26, 2013 Author Share Posted May 26, 2013 maybe 10 9 8 7 6 .... Quote Link to comment Share on other sites More sharing options...
Tyke Posted May 26, 2013 Share Posted May 26, 2013 Quote Link to comment Share on other sites More sharing options...
Jeff H Posted May 30, 2013 Share Posted May 30, 2013 Couple things to keep in mind and more detail if needed later but ModelSpace & Paperspace are just BlockTableRecords(Blocks) with a Layout associated with it. All BlockTableRecords with Paperspace layouts will contain a viewport and which you can think of it as what lets you view the paper, printing edges, etc... So if you have a "Floating viewport" - one that gives a view into model that BlockTableRecord will contain 2 viewports. You can check the BlocktableRecord that is associated with Paperspace layout to see what it contains and if empty that means it has never initialized, contains 1 viewport then it has been initialized but nothing in it, 2 or more viewports then has a viewport that has view of ModelSpace. Not sure what requirements are but you could check if the BlocktableRecords contain any entities so it might contain Titleblock, etc... Would be tough to cover all bases but especially from many different clients. Link to info about default viewport and reason why you do a erase all in model and will not let you erase 1 object from paperspace that is empty. http://www.theswamp.org/index.php?topic=44184.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.