
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I'm having a bit of a problem struggling with creating new dimension style using vee bee dot net, in AutoCAD 2010 environment. I am particularly trying to figure out how to set the newly created dimension style to color white, and to assign it a specific layer (for example, a layer called "test").
Does anyone know what the code syntax is to accomplish this?
I post the code below for what I have done thus far:
Public Shared Sub addDimensionStyle(ByVal strDimStyle As String)
Dim acDb As Database = HostApplicationServices.WorkingDatabase
Using acTrans As Transaction = acDb.TransactionManager.StartTransaction()
Dim dimTbl As DimStyleTable = acDb.DimStyleTableId.GetObject(OpenMode.ForWrite)
Dim dimTblRec As DimStyleTableRecord = Nothing
If dimTbl.Has(strDimStyle) = True Then
dimTblRec = dimTbl(strDimStyle).GetObject(OpenMode.ForRead)
Else
dimTblRec = New DimStyleTableRecord()
dimTblRec.Name = strDimStyle
dimTbl.Add(dimTblRec)
' Set the color index of the new dimension style here...
' Set the layer of the new dimension style here...
acTrans.AddNewlyCreatedDBObject(dimTblRec, True)
End If
acTrans.Commit()
End Using
End Sub
Any help is greatly appreciated.
Many thanks in advance...
Cat
Solved! Go to Solution.