.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

draw Mleader of existing multileader style

1 REPLY 1
Reply
Message 1 of 2
rhax
229 Views, 1 Reply

draw Mleader of existing multileader style

i need to draw mleader of specific predefined style lets say "Style1", i found a way how to define poperties of mleader, but not how use existing ones.
Does anybody have a something like this?

1 REPLY 1
Message 2 of 2
C_Witt
in reply to: rhax

just a snip..

Dim myDWG As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocument
Using ML_Trans As DatabaseServices.Transaction = myDWG.TransactionManager.StartTransaction
Dim myDB As DatabaseServices.Database = myDWG.Database
Dim myMLeader As New DatabaseServices.MLeader
Dim myMLStyleDict As DBDictionary = myDB.MLeaderStyleDictionaryId.GetObject(OpenMode.ForRead)
myMLeader.MLeaderStyle = myMLStyleDict.GetAt("Style1")

Dim bt As BlockTable = TryCast(ML_Trans.GetObject(myDB.BlockTableId, OpenMode.ForWrite), BlockTable)
Dim btr As BlockTableRecord
If ApplicationServices.Application.GetSystemVariable("cvport") = 1 Then
btr = TryCast(bt(BlockTableRecord.PaperSpace).GetObject(OpenMode.ForWrite), BlockTableRecord)
Else
btr = TryCast(bt(BlockTableRecord.ModelSpace).GetObject(OpenMode.ForWrite), BlockTableRecord)
End If
btr.AppendEntity(myMLeader)
ML_Trans.AddNewlyCreatedDBObject(myMLeader, True)
ML_Trans.Commit()
End Using

**Disclaimer: has not been tested **

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost