prab Posted September 20, 2009 Posted September 20, 2009 It looks like you are hooking into AutoCAD from an external VB6 executable: Is that correct? A couple of questions: This “drawing”, is it the only thing in ModelSpace? It sounds like the drawing may be too large to fit inside the viewport with a CustomScale = 1: Is the plan to scale the viewport such that it will fit . . . . at one of the standard scale, perhaps? Or - The drawing would always fit a 1:1 viewport if centered correctly? Also, this line seems to be referring to some custom class or User Defined Type: What are its specifications? yeah that's right. To add light to my problem. What i'm doing is i've multiple blocks of drawing in modelspace(eg series of rectangles of same dimesion with some spacing between them).Each rectangle has its centrepoint. Now for printing purpose i'm making viewports in paperspace. Now each rectangle should be printed in each viewport and the centre of each rectangle should be the centre of each viewport. Quote
SEANT Posted September 20, 2009 Posted September 20, 2009 Unfortunately, I’ll be away from the computer the rest of the day, but, look at the code example in post #10 of this thread. The way it centers the point dblWTarg may be pertinent to your situation. http://www.cadtutor.net/forum/showthread.php?t=29175 Quote
prab Posted September 21, 2009 Posted September 21, 2009 Unfortunately, I’ll be away from the computer the rest of the day, but, look at the code example in post #10 of this thread. The way it centers the point dblWTarg may be pertinent to your situation. http://www.cadtutor.net/forum/showthread.php?t=29175 thnks Seant..i finally got what i wanted..i just had to set the target of viewport to my centre point in modelspace... Can u help with drawing polygonal viewports?I'm searching the posts here Quote
SEANT Posted September 21, 2009 Posted September 21, 2009 Can u help with drawing polygonal viewports?I'm searching the posts here I’m not sure if there is a direct VBA way to create a non-rectangular viewport. At least, I’ve never had cause to investigate it. A quick search on this and other forums hasn’t turned up any clues, unfortunately. VB.NET would offer more capability with that type of task. Quote
prab Posted September 22, 2009 Posted September 22, 2009 i found a way to give commands to autocad as follows with acaddoc. acaddoc.sendcommand(".mview p 5,0 5,4 0,4 -5,4 -5,0 -5,-4 0,-4 5,-4 CL ") And this creates a polygonal viewport>but my problem is now how to set this viewport as active viewport so that I can centre my drawing using viewport.target command Quote
razorangel Posted April 5, 2010 Posted April 5, 2010 I read through this thread and was hoping someone could point me in the right direction. I'm looking to do something similar (I think) but the idea is to have the user place a block in the layout, over a viewport, and the block will automatically report back the coordinate of a point in that block. I can get the block to do MOSTLY what I want, but it only reports back the paperspace coordinate. Also, I need to find out how I can alter the format of the number it reports back. Right now, for example, I can get it to say "N. 1'-3 1/16"" but I really need it to report back "N. 0+01'-3 1/6". Or, for example, it will report, "E. 153'-6 3/4"" but I want it to say, "E. 1+53'-6 3/4"". Quote
Marvin7 Posted June 13, 2013 Posted June 13, 2013 I found the lisp from jtbworld.com, but I rename the command to VPO. All you have to do is type VPO and click on the viewport in paperspace and it will draw it automatically for you. I know this is an old topic, but it's apparently the most recent one that's applicable. I'm using that VPO (or vp-outline, whatever you want to call it) LISP routine and it works fine for top views, but not a side view. if I draw a 3D pyramid, then go to modelspace and create a viewport Top view of the pyramid and execute the VPO LISP, it creates a viewport bounding box in modelspace at z=0, which is great. But if I create another viewport and set it to a Left side view, executing VPO will only create a single polyline at z=0, not a bounding box. No one else that has used this LISP has this problem? As far as troubleshooting goes, it seems to make no difference what orientation I set the UCS to, either in model space or in an individual viewport. Also, another version of this LISP (but it can do every viewport in the entire drawing at once) is here: http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Outline-projection-all-viewports-to-model/m-p/3255920#M300815 But this one has the same problem. Quote
Lee Mac Posted June 13, 2013 Posted June 13, 2013 Please try my attached version of this type of program. Lee VPOutlineV1-0.lsp Quote
Marvin7 Posted June 13, 2013 Posted June 13, 2013 Please try my attached version of this type of program. Lee Now we're talking8) Yours worked correctly right away. Also, I clicked your signature link and visited your page. I've been to your site before but I didn't realize that was you. That's an impressive library of code you've written. Quote
Lee Mac Posted June 13, 2013 Posted June 13, 2013 Now we're talking Yours worked correctly right away. Also, I clicked your signature link and visited your page. I've been to your site before but I didn't realize that was you. That's an impressive library of code you've written. Thank you for your kind compliments Marvin, I'm pleased that the program performed as expected. I shall look to add it to my site when I get some spare time. Cheers, Lee Quote
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.