i'm looking for a lisp routine for intersect spline at coordinate value
example
1. select the splines
2. input value of coordinate (x=200 or y=400 or z=1000)
result points in drawing
Thank you
i must add that the spline is always perpendicular on
some axis (in this case its about ship frames and water lines).
Im not at home whith lisp programming but the way to do it can be
1.input value (like z=4000)
1.when select a string it takes a position of the axis
2. draw a perpendicolar line on the axis whit value -100000 +100000
2. find a intersection point between line and spline
3. delete the line
4.draw the point
Unfortunately, I don’t know lisp. I did set up a test VBA routine. It only works with one orientation, however, with a target elevation along the Z axis.
The routine works best from either a Front or Side view – and a point picked at the desired intersection plane.
*Correction: Only works with entities parallel to the Front view* not Side View
Sub PointsAtElevation()Dim dblPt(2) As DoubleDim ent As AcadEntityDim entMirror As AcadEntityDim varMin As VariantDim varMax As VariantDim dblThird(2) As DoubleDim dblElevation As DoubleDim varElevPt As VariantDim varReturn As VariantDim intCount As IntegerDim i As IntegerDim entPt As AcadPointDim objSS As AcadSelectionSetWith ThisDrawing On Error Resume Next .SelectionSets.Item("SSTemp").Delete On Error GoTo 0 Set objSS = .SelectionSets.Add("SSTemp") objSS.SelectOnScreen If objSS.Count < 1 Then Exit Sub varElevPt = .Utility.GetPoint(, "Select target elevation: ") If UBound(varElevPt) 2 Then Exit Sub For Each ent In objSS ent.GetBoundingBox varMin, varMax varMin(2) = varElevPt(2) varMax(2) = varElevPt(2) dblThird(0) = varMin(0) dblThird(1) = varMin(1) + 1# dblThird(2) = varMin(2) + 1# Set entMirror = ent.Mirror3D(varMin, varMax, dblThird) varReturn = entMirror.IntersectWith(ent, acExtendNone) intCount = ((UBound(varReturn) + 1) / 3) - 1 For i = 0 To intCount dblPt(0) = varReturn(3 * i) dblPt(1) = varReturn(3 * i + 1) dblPt(2) = varReturn(3 * i + 2) ThisDrawing.ModelSpace.AddPoint (dblPt) Next entMirror.Delete NextEnd WithEnd Sub
I'd say that it could not be done with plain AutoLISP. I guess my question would be how to deal with multiple intersections of the spline with the given plane. I would think that a full ship frame intersects say the water line in 2 places. -David
Fisrt thank you for the answer but my exsperience whith vba is very poor
and i am not good enough to use the code.
Second i wont to add that always we divide the body lines of the ship
in left side, right side(almost mirror of left side),fore part and aft part.
In this case there is no multiple intersections of the spline.
Can somebody make the whole vba or lisp routine ?
Greetings
Is it possible to post a sample file with the splines set up in a typical configuration? I’m envisioning a oriented 3D layout but guess I don’t know that for certain.
In general, an example file is the best way to give full scope to the problem in question. The “full scope” also seems to be the best way to generate interest and enthusiasm within in the resident code writing community.
sorry that i don't do it before
naw i attach one sample file with the splines set up in a typical configuration.
I must draw a lot of waterlines and then a lot of frames
Frames is in always situated in yz plane
and waterlines in xy plane
testforma.dwg