Jump to content

Modelspace coordinates from paperspace viewports?


hardwired

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • SEANT

    7

  • prab

    5

  • hardwired

    4

  • Jozi68

    3

Top Posters In This Topic

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

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 6 months later...

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"".

Link to comment
Share on other sites

  • 3 years later...
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Now we're talking 8) 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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...