Ejemplo n.º 1
0
def test_activate_document():
    catia = CATIAApplication()
    documents = catia.documents()
    documents.open(cat_part)
    document_part = catia.document()
    documents.open(cat_product)
    document_product = catia.document()

    assert document_part.name == os.path.basename(cat_part)
    assert document_product.name == os.path.basename(cat_product)

    document_part.activate()
    document = catia.document()

    assert document.name == os.path.basename(cat_part)

    document_part.close()
    document_product.close()
Ejemplo n.º 2
0
        <point_name>,<x coordinate>,<y coordinate>,<z coordinate>

"""

from pycatia import CATIAApplication
from pycatia import create_points

catia = CATIAApplication()
# disable display refreshing to try tp speed up point generation.
catia.refresh_display(False)
# hide catia window
catia.visible(False)

documents = catia.documents()
# create a new part.
documents.add('Part')

document = catia.document()
part = document.part()

# full path name to csv file.
file = r'tests\Sample_Point_CSV_File1_small.csv'

# create the points in currently open CATIA part.
create_points(catia, part, file, 'in')

# re-enable display refresh
catia.refresh_display(True)
# unhide catia window
catia.visible(True)