Jump to content

need lisp_Get "XYZ" value in 2d dwg


Shibuboss

Recommended Posts

Hi,

 

with out making any 3d dwg how can i get the xy& z coordinates with the help of a lisp.here we have starting lvl (+6.975) and ramp ending lvl (+8.100). please help ...ZValue_zps1171d18e.jpg.html

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • neophoible

    8

  • eldon

    7

  • BIGAL

    4

  • Shibuboss

    2

Top Posters In This Topic

Posted Images

Providing the object say a line is 3d then this will work

 

(setq 3dpt (Getpoint"\Select point"))
(setq  ans (strcat "x= " (rtos (car 3dpt) 2 3) "  y=" (rtos (cadr 3dpt) 2 3) ans "  z=" (rtos(caddr 3dpt) 2c3))
(princ ans )

Link to comment
Share on other sites

I would question why you thought that you needed a Lisp to calculate a simple geometric problem.

 

The length along the centre line is known, so I would draw out an elevational view along the centre line, so that the horizontal length was along the X axis and the elevation was along the Y axis. Then you could pick off the intermediate elevations wherever you wanted. :D

Ramp.JPG

Link to comment
Share on other sites

I would question why you thought that you needed a Lisp to calculate a simple geometric problem.

 

Thanks for the reply eldon.

but i want to work on the plan only.. if we give the starting and ending lvls and length of the curve in the lisp, is it to possible to get the "Z" coordinates along with "x&y" coordinates?

 

Thank you.

Link to comment
Share on other sites

I am not sure that writing a push-button solution (often a synonym for Lisp) would be sufficiently challenging for an expert. But there again, someone might be having a slack time, and I would be proved wrong.

 

I shall follow this thread with interest.

Link to comment
Share on other sites

Actually, it sounded pretty simple, until the word ‘curve’ was mentioned. If it really is a curve (segment of a circle?) and you are providing the endpoints and the length (of the arc?), I am very interested in what the “formula found in most engineering road design handbooks” looks like. If you are just dealing with a straight line, then the formula is simply the proportionality for similar triangles and quite easy to program, as eldon has said.

Link to comment
Share on other sites

Shibuboss I thinks its really back to you to explain more what you want I think we are all guessing post a dwg etc.

 

neophoible its pretty easy to find xyz of a point on all the common objects line arc circle pline its a different method for each object some mathmatically others use autocad to do the work eg pline.

Link to comment
Share on other sites

Please post a dwg are you talking about road vertical curves ? This is a formula found in most engineering road design handbooks.

 

neophoible its pretty easy to find xyz of a point on all the common objects line arc circle pline its a different method for each object some mathmatically others use autocad to do the work eg pline.

 

Yeah, I agree that it’s pretty easy to pick a point on an object and let AutoCAD tell you what its coordinates are. It sounds now like you may be saying that some would resort to drawing the curve, at least temporarily, in order to get the point’s XYZ. But I wonder just how easy even that is based on the input the OP is suggesting--just two endpoints and a non-linear distance; no angle, no radius, no other points. In drawing an Arc, if I input the two endpoints, AutoCAD does not seem to offer to draw the arc based on its length. The closest option I see is to draw it based on a tangent direction; however, that is an angle input, not a length.

 

Of course, my Q was about a formula for finding the point on a curve when you don’t have the object to pick, which is what it looked like you and the OP were talking about. I’m sure some mathematician could derive a formula for it. It’s that derived formula I’m interested in. I know that it’s fairly straightforward mathematically to get the length of an arc/chord given the radius/angle, but I’ve found that it doesn’t seem to be so obvious the other way round, even for AutoCAD. So, I am still very interested in what the “formula found in most engineering road design handbooks” looks like.

Link to comment
Share on other sites

Just draw a wheel with spokes and think about it and you can work out a ratio of rise/run v's arc angle for Z obviously you can also work out XY.

 

Just google surveying formula for curves lots of theory.

Link to comment
Share on other sites

  • 3 weeks later...
Just draw a wheel with spokes and think about it and you can work out a ratio of rise/run v's arc angle for Z obviously you can also work out XY.

 

Yeah, no doubt you can draw something and work something out in some form or fashion, but remember we're talking here about doing this without the angle information. I've been told that to do it via calculation alone involves some form of calculus.:shock: I'm thinking I'll just leave at that for now.

Link to comment
Share on other sites

I would have thought that elementary algebra would do instead of calculus.

 

You have a known horizontal length. It is not necessary to know that part of the length is around a curve, because you will not be using the curve's properties in any part of the calculation.

 

You have a known difference in height. And the rest is a simple matter of proportion.

 

A lisp is useful when there are many instances of a particular routine. This particular case seems to be a one-off, unless you build into it a variable straight length with a variable curve length, with possible another straight length, all combined with a variable change in height, all with a variable position of the required height.

 

Even though the calculation does not require a sophisticated level of calculus, I think that you are right to leave it alone.

 

Drawing a temporary section is much easier, as in my first post. Let AutoCAD do the calculation :D

Link to comment
Share on other sites

I would have thought that elementary algebra would do instead of calculus.
Maybe, but per my experience with math & science textbook names, 'elementary' seems to be a very relative term.:shock:

 

You have a known horizontal length. It is not necessary to know that part of the length is around a curve, because you will not be using the curve's properties in any part of the calculation.
Sounds like we are talking about two very different things here. The curve is what I'm talking about. Its properties are thus essential.

 

You have a known difference in height. And the rest is a simple matter of proportion.
Again, it's the curve I'm talking about, which would not be a simple proportion, though perhaps it's easier than I've been thinking.

 

Even though the calculation does not require a sophisticated level of calculus, I think that you are right to leave it alone.
Regarding programming, we don't leave it alone because it's easy enough to draw, rather we program it because it can be drawn so much faster. We've left the competition in the dust by being able to do just that sort of thing. But I don't think we disagree on this point.

 

Drawing a temporary section is much easier, as in my first post. Let AutoCAD do the calculation :D
Or maybe not, as you suggest in this Thread: Can´t draw a correct arc length,please help.

 

By the way, up to this point, the problem in that thread, which is very closely related to this one, appears to have been solved only via Inventor and the online Circle Calculator you and the OP cited. Hmmmm. There's my answer. Well, sort of. Whatever it's programmed with appears to be exactly what I've been looking for!

Link to comment
Share on other sites

If you read the original post, I think that you are making a mountain out of a molehill.

 

In the OP's drawing, the length along the straight and the length along the curve were annotated, and therefore the problem is one of simple proportion from one elevation to another.

 

If the arc length, which in this case encompassed a right angle, had not be known, then you would need extra calculation. But it was not necessary in this particular case, hence my comment about not needing to know that it was a curve.

Link to comment
Share on other sites

In the OP's drawing,...
What OP drawing? BIGAL asked him to post one, but the only one I see is yours. Are you attributing your image to the OP?
Link to comment
Share on other sites

This is the image that was posted with the first post. Perhaps my browser is better :o

Interesting; maybe even strange. No, it feels more like bizarre. Your images came through just fine. I've not noticed any missing images elsewhere on the forum thus far. Yet in this case, there isn't even a hint on my screen that the OP posted anything, at least until now. Well, he does say 'here', but that's a bit ambiguous. Perhaps, then, you were a little confused as to why BIGAL would, not just once but twice, request the OP post a drawing? By the way, what browser are you using?

Link to comment
Share on other sites

I am using Google Chrome. and the OP did not post the image in the usual way. I right clicked on the image after "help..." and then saved the image.

SeeingWith Chrome.JPG

Link to comment
Share on other sites

I am using Google Chrome. and the OP did not post the image in the usual way. I right clicked on the image after "help..." and then saved the image.

 

OK, eldon, thanks for the info. This might be worth noting somewhere for all the folks on the forum. Perhaps you would know where/how best to do that? Or perhaps this is already discussed somewhere and otherwise well-known?

 

The icon after help as shown in your pic of the OP doesn't show up on my screen in any way, shape or form, even if I try to select & highlight everything in the post, not even if I try clicking in the area.:shock: I'm guessing BIGAL had/has a similar situation.

 

I may have to invoke Google Chrome after all. I'm using Mozilla Firefox 18.0.1 currently.

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