当前位置: 首页>>代码示例>>Python>>正文


Python Application.getApplicationStyle方法代码示例

本文整理汇总了Python中application.Application.getApplicationStyle方法的典型用法代码示例。如果您正苦于以下问题:Python Application.getApplicationStyle方法的具体用法?Python Application.getApplicationStyle怎么用?Python Application.getApplicationStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在application.Application的用法示例。


在下文中一共展示了Application.getApplicationStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: textApplication

# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import getApplicationStyle [as 别名]

#.........这里部分代码省略.........
        self.performCommandRandomly("ARC")
        self.__pyCadApplication.ActiveDocument=doc2
        self.outputMsg("Create Ellipse")
        self.performCommandRandomly("ELLIPSE")
        self.outputMsg("Create Polyline")
        self.performCommandRandomly("POLYLINE")
        self.outputMsg("Create ACLine")
        self.performCommandRandomly("ACLINE")
        
        self.outputMsg("Get Entitys for doc 1")
        self.__pyCadApplication.ActiveDocument=doc1
        activeDoc=self.__pyCadApplication.ActiveDocument
        ents=activeDoc.getEntityFromType("ALL")
        self.printEntity(ents)
        self.outputMsg("Get Entitys for doc 2")
        self.__pyCadApplication.ActiveDocument=doc2
        activeDoc=self.__pyCadApplication.ActiveDocument
        ents=activeDoc.getEntityFromType("ALL")
        self.printEntity(ents)
        # Working with styles
        self.outputMsg("Create NewStyle")
        stl=Style("NewStyle")
        self.outputMsg("Save in document")
        activeDoc.saveEntity(stl)
        activeDoc.setActiveStyle(name='NewStyle')
        self.outputMsg("Create Segment")
        self.performCommandRandomly("SEGMENT")
        self.outputMsg("Create Arc")
        self.performCommandRandomly("ARC")
        
        self.outputMsg("Create NewStyle1")
        stl1=Style("NewStyle1")
        self.__pyCadApplication.setApplicationStyle(stl1)
        stl11=self.__pyCadApplication.getApplicationStyle(name='NewStyle1')
        styleDic=stl11.getConstructionElements()
        styleDic[list(styleDic.keys())[0]].setStyleProp('entity_color',(255,215,000))
        self.__pyCadApplication.setApplicationStyle(stl11)
        activeDoc.saveEntity(stl11)
        self.outputMsg("Create Segment")
        self.performCommandRandomly("SEGMENT")
        self.outputMsg("Create Arc")
        self.performCommandRandomly("ARC")
        
        self.outputMsg("Create NewStyle2 ")
        stl1=Style("NewStyle2")
        stl12=activeDoc.saveEntity(stl1)
        styleDic=stl11.getConstructionElements()
        styleDic[list(styleDic.keys())[0]].setStyleProp('entity_color',(255,215,000))
        self.outputMsg("Update NewStyle2")
        activeDoc.saveEntity(stl12)
        self.outputMsg("Done")
        # Test  Geometrical chamfer ent
        self.GeotestChamfer()
        # Test Chamfer Command 
        self.testChamferCommand()
        
    def testGeoChamfer(self):    
        self.outputMsg("Test Chamfer")
        p1=Point(0.0, 0.0)
        p2=Point(10.0, 0.0)
        p3=Point(0.0, 10.0)
        s1=Segment(p1, p2)
        s2=Segment(p1, p3)
        cmf=Chamfer(s1, s2, 2.0, 2.0)
        cl=cmf.getLength()
        self.outputMsg("Chamfer Lengh %s"%str(cl))
开发者ID:chiamingyen,项目名称:PythonCAD_py3,代码行数:70,代码来源:test_kernel.py


注:本文中的application.Application.getApplicationStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。