CaveMan Posted February 29, 2012 Posted February 29, 2012 Good Day Looking for Assistance With the image above I would like the user to select the line to insert the selected section and extrude it according to the line Have to orientate the UCS perpendicular to endpoint of line, Insert the Section, and then extrude it the same as the line length chosen. Just need assistance in defining the UCS's to the line?? Any help most appreciated Thanks in Advance Quote
fixo Posted February 29, 2012 Posted February 29, 2012 Not tested : Public Shared Sub UcsByLine(ln As Line) Dim pt1 As Point3d = ln.StartPoint Dim pt2 As Point3d = ln.EndPoint Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor Dim zAxis As Vector3d = ed.CurrentUserCoordinateSystem.CoordinateSystem3d.Zaxis Dim xAxis As Vector3d = pt1.GetVectorTo(pt2).GetNormal() Dim yAxis As Vector3d = zAxis.CrossProduct(xAxis).GetNormal() Dim mat As Matrix3d = Matrix3d.AlignCoordinateSystem(Point3d.Origin, Vector3d.XAxis, Vector3d.YAxis, Vector3d.ZAxis, pt1, xAxis, _ yAxis, zAxis) ed.CurrentUserCoordinateSystem = mat 'ed.UpdateTiledViewportsFromDatabase(); End Sub ~'J'~ Quote
CaveMan Posted March 1, 2012 Author Posted March 1, 2012 Thanking You Kindly My (Our) application is coming quiet fine Apprecite your input again Enjoy the day Quote
fixo Posted March 19, 2012 Posted March 19, 2012 Sorry for the late response I've lost this thread You're quite welcome Happy coding Regards, Oleg Quote
Recommended Posts
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.