本文整理汇总了Python中application.Application.getDocuments方法的典型用法代码示例。如果您正苦于以下问题:Python Application.getDocuments方法的具体用法?Python Application.getDocuments怎么用?Python Application.getDocuments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.getDocuments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: textApplication
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import getDocuments [as 别名]
#.........这里部分代码省略.........
create a new document
"""
try:
self.__pyCadApplication.newDocument(None)
except (IOError, EmptyFile):
self.outputMsg("Unable To open the file %s"%str(filePath))
def createStyle(self):
"""
create a new style object
"""
styleName=self.inputMsg("Write style name")
stl=Style(styleName)
doc=self.__pyCadApplication.ActiveDocument
doc.saveEntity(stl);
def getActiveDoc(self):
"""
print the active document
"""
try:
doc=self.__pyCadApplication.ActiveDocument
self.outputMsg("Active Document is %s"%str(doc.dbPath))
except:
self.outputMsg("Unable To Perform the getActiveDoc")
def setActiveDoc(self):
"""
set the active docuement
"""
try:
lookIndex=self.inputMsg("Write the number of doc that you are looking for")
i=0
docs=self.__pyCadApplication.getDocuments()
if len(docs)<int(lookIndex):
self.outputMsg("No such a document")
return
for key in docs:
if i == int(lookIndex):
self.__pyCadApplication.ActiveDocument=docs[key]
return
i+=1
else:
self.outputMsg("Document not found")
except:
self.outputMsg("Unable To Perform the setActiveDoc")
def showDocuments(self):
"""
show The list of documents
"""
try:
self.outputMsg("Documents in the curret application")
i=0
for key in self.__pyCadApplication.getDocuments():
self.outputMsg("%s File %s"%(str(i), str(key)))
i+=1
self.outputMsg("***********************************")
except:
self.outputMsg("Unable To Perform the GetDocuments")
def closeFile(self):
"""
close the active Document
"""
try: