CAD关于图层当前层操作(com接口网页版)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/u013725001/article/details/102736991

当前层表示DWG数据库默认层,向数据库中添加一个对象时,默认放到该层上,该属性随图存放,通过系统变量CLAYER操作,系统变量设置参考:http://www.mxdraw.com/help_2_48.html

设置当前层代码JS:

    // 新建一个图层
    mxOcx.AddLayer("MyLayerName");
    // 设置当前层
    mxOcx.SetSysVarString("CLAYER", "MyLayerName");
    // 设置控件Draw函数使得的层
    mxOcx.LayerName = "MyLayerName";

或者这样:

     // 添加层
     mxOcx.AddLayer("aaaa");
     // 得到当前数据库
     var database = mxOcx.GetDatabase();
     // 设置当前层
     database.CurrentlyLayerName = "aaaa";

猜你喜欢

转载自blog.csdn.net/u013725001/article/details/102736991