TAGGED: scripting, spaceclaim
-
-
December 11, 2019 at 3:14 pm
Guillaume ANFOSSI
SubscriberHello,
Is there a possibility to import a file (txt or csv) containing circle coordinates (x, y and diameter) ?
Thanks,
-
December 11, 2019 at 10:01 pm
Brian Bueno
Ansys EmployeeGUICAD
It's probably easiest to do this with a script. The syntax in items 1 & 2 is standard for Python. I think it will work in the script editor, but you might need to make some minor changes.
- Read the file into the script
# Open function to open the file "MyFile1.txt"Â
# (same directory) in append mode and
file1 = open("MyFile.txt","a")
 - Iterate to pick up 1 set of (X, Y, r) values: File_object.readline([n])
 - Create the circle:
# Set Sketch Plane
selection = DatumPlane1
result = ViewHelper.SetSketchPlane(selection, Info3)
# EndBlocks# Sketch Circle
origin = Point2D.Create(MM(X), MM(Y))
result = SketchCircle.Create(origin, MM(r))
# EndBlock -
Repeat the process for the next set of (X, Y, r) values
- Read the file into the script
-
- The topic ‘insert a txt file with circle coordinates’ is closed to new replies.
-
6750
-
1906
-
1484
-
1324
-
1087
© 2026 Copyright ANSYS, Inc. All rights reserved.