Is there a way to use AddFixedCurve() that takes 3 points and a previous entity id, without a previous entity id? Like by sending some sort of null?
I cannot seem to extract the information required to recreate fixed 3 point arcs properly. The only one without an entity requirement that looks like it could work for me is the Point3d, Vector3d, Point3d version and taking StartDirection to use for the Vector3d. Except for the ridiculousness of how alignment creation tools require Point3d/Vector3d/Enums and the properties actually stored on the alignments are Point2d/Doubles/Booleans.
I'm currently using
private Vector3d vectorize(double dir) { return new Vector3d(Math.Sin(dir), Math.Cos(dir), 0); }
to convert between the directions given from any of the AlignmentEntities. Maybe that isn't the right thing? Because I'm getting some horrible results doing fixed curves (StartDirection) but it seems to work for float curves (DirectionAtPoint2).
Any help or hints would be appreciated. Pretty much the rest of the code is just pulling info from one alignment and using that to recreate the entities in another. Works perfectly for most things except these dang fixed curves.
Solved! Go to Solution.
Solved by tyronebk. Go to Solution.
Use this version of the method (which I believe you are):
public AlignmentArc AddFixedCurve( int previousEntityId, Point3d startPoint, Point3d middlePoint, Point3d endPoint )
and specify 0 for the previousEntityId. That looks like what I've done in one of my old commands and it seems to work fine.
I wasn't sure if that was going to work so I avoided it. I'll give it a try! I'll report back either with problems or a solution click.
Thanks
Hi byarmak,
If you don't want to use previous enityt id then you have other options too. Please check this link below for different type of AddFixedCurve() like the following one -
public AlignmentArc AddFixedCurve( Point3d centerPoint, Point3d passThroughPoint, bool isClockwise )
Thanks,
I've been looking into those, the only one I could find that actually has a chance to make the exact 3 point curve from the information able to be gotten from an existing 3 point curve I believe is the Point3d, Vector3d, Point3d one that has the starting direction along with start and end passthrough points. Except I failed at making the Vector3d from the StartDirection property of another curve (which might mean that my private method that does that calculation might be flawed and will break... more testing required).
Just finished testing the previous suggestion of just using 0 as prevId, and it worked great. Every alignment I tested (I'm using Isaac Rodriguez' test alignment drawing included with his Colibra library download, and it has a pile of alignments) worked using this method. I was avoiding trying to require a previous entity id because it would have required overloading one of my semi-recursive commands that goes through to copy the AlignmentEntities and force some extra logic in places where I shouldn't really need it.
Thanks again for the help everyone.
Can't find what you're looking for? Ask the community or share your knowledge.