Hi All,
Here is my challenge: I have a 3d polyline (see the attached dwg, 3d poly in green) that varies in x, y and z.
Then I have a line (green) with the exact length of 10 000 drawing units.
I want to be able to do either of these two things, which really serve the same goal:
1. To rotate the line about the origin in 3D so that the endpoint (10 000 from the origin) touches the 3D polyline.
2. To locate the point on the 3D polyline that is exactly 10 000 units from the start of the polyline/origin (not along the poly, measured as a straight line, therefore similar to point 1.)
Any suggestions are greatly appreciated,
Samu
Solved! Go to Solution.
Solved by dbroad. Go to Solution.
Solved by SEANT61. Go to Solution.
I don't know about 3d. I haven't even looked at your drawing, BUT
I suggest you draw a sphere which is 10000 in diameter, then where it crosses the 3D polyline is where the end of your straight polyline should go
Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Hwalker,
Thanks for the reply and that is exactly what I originally did. I could not grab onto the point where the sphere intersected the polyline, but I extruded the 3D polyline as well and used extrim, and by exploding the surface which was left of the 3D polyline extrusion I ended up with a spline, where the endpoint was the exact location on the 3D poly.
However, I was hoping to find a quicker and more elegant solution, since the dwg I sent is just an example of something that will need to be performed tens if not hundreds of times.
Thanks,
Samu
I've just tried a quick dirty trick which might work
This was only in 2D though
I made 2 polylines and rotated one, so that the end point was at the APPARENT INTERSECTION of it and the other polyline and it seemed to work.
You might need to use a 3D Rotate though
Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
That's exactly it, I can make it work in 2D, but obviously do not know how to use 3Drotate to make it work in 3D...
Samu
Unfourtunately you will need a 3D guru for that.
Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Try this command macro (Uses the Sphere intersection method):
^C^C_Sphere;end;\\_Imprint;Last;\n;;_Explode;Last;
The sequence of events is something like this.
First, set the PDMODE to something visible.
The macro is envoked, the user selects the start of the 3dPoly, enters the desired distance.
The appropriate shere is created.
The user then selects the 3DPoly.
A point is created at the intersection od sphere and Poly.
That procedure, and macro call creates this output at the command line.
Command: PDMODE
Enter new value for PDMODE <0>: 66
Command:
Command: _Sphere
Specify center point or [3P/2P/Ttr]: end
of
Specify radius or [Diameter] <1.0000>: 10000
Command: _Imprint
Select a 3D solid or surface: Last
Select an object to imprint:
Delete the source object [Yes/No] <N>: n
Select an object to imprint:
Command: _Explode
Select object: Last
@Anonymous wrote:
..
Any suggestions are greatly appreciated,
Samu
I thought you had access to Autodesk Inventor?
In Inventor I would do a 3D sketch, dimension the line and add coincident constraint.
SEANT61,
Nice solution, well explained.
Here is a programmatic solution. Save the program with a name that makes sense to you, in your trustedpaths folder, and with a .LSP extension. It changes the endpoint of the line to be at the appropriate point.
;;no error checking. D.C. Broad 2014 (defun c:test ( / ep param p1 p2 pt1 pt2 d1 d2 x l ptx ei el d) (prompt "Select 3dpoly") (setq ep (car (entsel))) (prompt "Select line") (setq el (car (entsel))) (setq ei (entget el)) (setq d (distance (cdr(assoc 10 ei))(cdr(assoc 11 ei)))) (setq param (vlax-curve-getparamatdist ep d)) (setq p1 (fix param) ;vertex param earlier p2 (1+ p1);vertex param later pt1 (vlax-curve-getpointatparam ep p1);point at p1 pt2 (vlax-curve-getpointatparam ep p2) d1 (distance pt1 '(0 0 0)) d2 (distance pt2 '(0 0 0)) l (- d2 d1) x (- d d1) px (+ p1 (/ x l)) ptx (vlax-curve-getpointatparam ep px)) ;linear interpolation (prompt "Select line") (entmod (subst (cons 11 ptx) (assoc 11 ei) ei));assume 2nd point. (princ))
SEANT61 and dbroad,
Both the macro and lisp work great - exactly what I was looking for, thank you!
Regardingt the macro: I tried imprint before, but find it curious that you have to explode the sphere before the imprinted point appears... Had no idea, until now.
I was also able to get really close by gripping onto the right end of the line, with the dynamic input turned on I locked the length to be 10 000, and then brought the end of the line down to the 3d poly and snapped onto it.
JD, I do have Inventor, and what you described is how I would have done it. I am doing this in AutoCAD to feed my own curiosity and also help a guy who only has AutoCAD.
Thank you!
Samu
I ran the routine outlined, but it only prompted for a 3D polyline, which it failed to select and thus aborted.
Any ideas why it failed?
Did you have a 3d polyline to select in the drawing?
Did you select it?
Did you have another line?
Did you select it?
Post a drawing you attempted to use it with.