I want to create a line on a surface.
I have a face who's surface I access then I use the ICreateNewCurve method, but I don't see how I can set the properties for that curve.
How can I create a line on a surface?
I have created a macro for you. Preselect the edge then sketch line and run the macro. It will create a point at intersection.
Application Engineer at Intercad
Tel: +61 2 9454 4444
Use Modeler::CreateLine to create a curve. Note the ICurve is the 'virtual' object and you cannot see it in the graphics view. In order to temporarily display it use Curve::CreateWireBody->Body2::Display3. What is your final goal? Do you like to create a entity on this face for later use? Why don't you like to use sketch entities?.
I did use Sketch entities.
I need to find an intersection point between two curves.
I wanted to use ICurve::IntersectCurve and the API help did not list that SketchLine has a method called GetCurve(); I'm guessing that, that method is inherited from some higher class and the API help documentation does not like to talk about inheritance. I'm lucky that Visual Studio’s Intellisense told me about it; but that still hasn't helped me.
SketchSegment::GetCurve where SketchSegment is teh parent class of SketchLine. Just cast it.
I got the curve but the intersection still eluded me.
I was able to select both curves then set a constrain for intersection "sgATINTERSECT" place a SketchPoint retrieve that point through GetSketchPoints2.
It's such a mess but it's been over a week, and this shouldn't be happening.
Did mentioned I'm new to Solid Works (Coming from Rhino world)?
This was my original attempt, I gave more code just in case people wonder if I have my objects right.
Are you using 2D sketches? If so you need to apply the transform for the curve:
Sketch::ModelToSketchTransform (I think should be inversed).
Try test case with 3d sketch lines.
The Sketch is done via a face like so:
Dim swEnt As Entity = swSketchFace
If I use my own Vectors and Points then I have to apply the modelToSketch transform, but the SketchLine-s look good; i.e. on the surface, of course looks can be deceiving.
I just noticed that InsertSketch2 is absolete.
Are you looking for SketchLine-Edge intersection?
I'm taking the edge's curve and I also make sure that both curves are trimmed.
I have to re work the code back to where it used to be and then I'll give it a shot.
So far, the main difference is that you apply the inverse transform to the sketched curve, and the minor one (maybe not) is that you're using Evaluate2 to get the points on the curves.
I'm having high hopes for this, thank you again
Note if you get the end points from SketchLine you should also apply the transforms to them that's why I'm getting the end points from the transformed curve.
Retrieving data ...