Hi Rushikesh,
Thanks for your reply.
I have points and lines in json. My intention is to draw a sketch in F360:
This is my code:
with open(input_filename) as json_file:
json_data = json.load(json_file)
# Create sketch points
# points are created and saved as a map
point_map = {}
for point in json_data['points']:
p_id = point['id']
xyz = point['xyz']
point = adsk.core.Point3D.create(float(xyz[0]), float(xyz[1]), float(xyz[2]))
sketchPoints.add(point)
point_map[p_id] = point
for ent in json_data['entities']:
ent_id = ent['id']
ent_type = ent['type']
if ent_type == 'line': # line
p0_id = ent['attributes']['startPointId']
p1_id = ent['attributes']['endPointId']
# get point from id. Points can be shaed by several lines.
p0 = point_map[p0_id]
p1 = point_map[p1_id]
sketchLines.addByTwoPoints(p0, p1)
After drawing, I expect to stretch the shape when dragging one line (blue), but actually only one line will move, while others do not move. It seems they are not joined.
Is it possible to make lines joined like a rectangle?
Thanks
Shoudong
Shoudong Xu
Autodesk Moldflow Meshing
Shoudong.Xu@autodesk.com