Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting modelspace coordinates from paperspace?!

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

Is there a way of translating modelspace coordinates from within paperspace?

I have developed a small level pick point results thingy routine - basically the user pick a point in modelspace on one of our construction drawings and a msgbox displays the level / elevation of the picked point in metres, shown as +12.980 for example..

This works fine but i want to be able to pick the point in paperspace - on the layout showing that particular section / detail / elevation etc - so that the level figure can be inserted on the layout, which is where we do all our annotation and text etc..

So basically, the user picks the point on the model but in the paperspace viewport, but really want to do this without entering the viewport itself. At the moment doing it that way only displays the actual paperspace coordinate, but i would like it to calculate the coordinate of the model itself..

I can't see that this would be possible but i thought i would throw this out there and see if anyone has any ideas of a good way round it or solution..


Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 1.25GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
Hi Paul,

I think you're right, that there is no canned way of doing this, you may however get away with some trickery, and math calculations.

When the user goes to pick the point, you may just switch to modelspace through the viewport and then calculate your results based on the view port scale...

Sorry if that's no help
Todd
 
Hi, yeah i thought it would be an impossible mission to do it directly, but have added to the routine that if modelspace is active, then keep it active and allow the level to be picked there, but if in paperspace ie: on the layout to be dimensioned, then i want the code to take the user into the viewport, but all it does is go back to modelspace itself, not modelspace through the viewport...

Code:
' Check current space..
If ThisDrawing.ActiveSpace = acModelSpace Then
    GoTo PICK
ElseIf ThisDrawing.ActiveSpace = acPaperSpace Then
    ThisDrawing.ActiveSpace = acModelSpace
    GoTo PICK
End If

....that's what i have for the space checking so far, but need to get it right so it does floating modelspace as they call it..

Any ideas?



Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 1.25GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
Hi Paul,

Best I can come with is an API call to actually use screen pixels to measure a cursor location. AutoCAD doesn't have the concept of translating modelspace coordinates to paperspace coordinates the way Inventor does...

Seems to me Randal Rath did something years ago with screen dimensions and pick locations, but I never had a use for it so I didn't follow it much but I think he was using it to translate cursor location to actual AutoCAD locations (x,y). You'll have to google it and see if you can find it - I don't remember ever using it so I'm afraid I don't have it but it could be out in the ether somewhere...

HTH
Todd
 
Thanks,

Thats a great help. Tried googlin' that Randal Rath thing but to no avail, but will keep looking and if i come up with something good and get it all working properly, i shall let you know..

Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 1.25GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top