本文整理汇总了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))