本示例使用属性设置通过对象的颜色电流。DatabaseCecolor VB.NETImports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.Colors <CommandMethod("SetColorCurrent")> _ Public Sub SetColorCurrent() '' Get the current document Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument '' Set the current color acDoc.Database.Cecolor = Color.FromColorIndex(ColorMethod.ByLayer, 256) End Sub C#using Autodesk.AutoCAD.Runtime; using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.Colors; [CommandMethod("SetColorCurrent")] public static void SetColorCurrent() { // Get the current document Document acDoc = Application.DocumentManager.MdiActiveDocument; // Set the current color acDoc.Database.Cecolor = Color.FromColorIndex(ColorMethod.ByLayer, 256); } 相关概念父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:22
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.