Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm writing a .Net extension for AutoCAD and I've been unsucessful in trying to make dimensions in 3d (i.e. on the z axis). Here is the code that I'm have to try to accomplish this:
Dim doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db = doc.Database Dim ed = doc.Editor Using trx As Transaction = db.TransactionManager.StartTransaction() ' Open the Block table for read Dim bt As BlockTable = TryCast(db.BlockTableId.GetObject(OpenMode.ForRead), BlockTable) ' Open the Block table record Model space for write Dim acBlkTblRec As BlockTableRecord = trx.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite) ' Create the dimension Dim acRotDim As RotatedDimension = New RotatedDimension() acRotDim.SetDatabaseDefaults() acRotDim.XLine1Point = New Point3d(120, 120, 0) acRotDim.XLine2Point = New Point3d(120, 120, 120) acRotDim.DimLinePoint = New Point3d(140, 120, 0) ' Add the new object to Model space and the transaction acBlkTblRec.AppendEntity(acRotDim) trx.AddNewlyCreatedDBObject(acRotDim, True) trx.Commit() End Using
When this code is run the dimension is created and the extension line snaps are in the correct places. However, the lines and text are stuck on the "ground" and it's shows a distance of 0. How can I create the dimension so that it's on the right plane?
Solved! Go to Solution.