Community
I'm converting my VBA over to VB.net and I'm getting stuck on this procedure.
Function CurrentLayerKeyStyle() As String 'returns the current Layer Key Style name On Error Resume Next Dim objDoc As AecArchBaseDocument Dim objLKS As AecLayerKeyStyle Set objDoc = AecArchBaseApplication.ActiveDocument Set objLKS = objDoc.LayerKeyStyles(objDoc.Preferences.LayerStandard) CurrentLayerKeyStyle = objLKS.Name End Function
trying to use Autodesk.Aec.ApplicationServices.DrawingSetupVariables.LayerStandard, but I'm not even sure if I'm barking up the right tree.
Solved! Go to Solution.
Solved by Jeffrey_H. Go to Solution.
This will write the current layer standard in the commad line hope it helps
Imports Autodesk.AutoCAD.ApplicationServices.Application Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.EditorInput Imports Autodesk.AutoCAD.Runtime Imports AecAppServies = Autodesk.Aec.ApplicationServices Public Class Examples <CommandMethod("CurrentLayerKeyStyle")> _ Public Sub CurrentLayerKeyStyle() Dim db As Database = HostApplicationServices.WorkingDatabase Dim ed As Editor = DocumentManager.MdiActiveDocument.Editor Using tr As Transaction = db.TransactionManager.StartTransaction Dim objID As ObjectId = AecAppServies.DrawingSetupVariables.GetInstance(db, False) Dim dsv As AecAppServies.DrawingSetupVariables = tr.GetObject(objID, OpenMode.ForRead) Dim ls As String = dsv.LayerStandard ed.WriteMessage(vbCrLf & ls) End Using End Sub