PanHasan Posted March 7, 2010 Posted March 7, 2010 Hi how can I append a 3d sphere into the drawing. Sample below works for the circle but not for the spheres why and how to solve this thx Public Sub addSpheres() Dim lcmd As Editor = Application.DocumentManager.MdiActiveDocument.Editor Dim acbaza As Database = lcmd.Document.Database Using trn As Transaction = acbaza.TransactionManager.StartTransaction Dim btr As BlockTableRecord = CType(trn.GetObject(acbaza.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord) Dim sph As Sphere = New Sphere(1, New Point3d(1.0, 1.0, 1.0), Vector3d.XAxis, Vector3d.YAxis, 0.0, 0.0, 0.0, 0.0) btr.AppendEntity(sph) trn.AddNewlyCreatedDBObject(sph, True) trn.Commit() End Using End Sub Quote
ollie Posted March 10, 2010 Posted March 10, 2010 You could insert a circle and revolve said circle into a sphere EDIT: (setq f(vla-addsphere (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point(list 0.0 0.0 0.0 )) ;Insertion point 20.0)) ;Radius The above code is what you're looking for i think I don't have VBA in 2010 but the code should be roughly Activedocument.modelspace.addsphere(insertionPoint, radius) As far as I am aware pre existing entites don't require a constructor statement in VBA 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.