Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've been working with custom graphics and managed to draw lines, now I'm attempting to draw some points in a similar way, but they do not appear after refreshing the view. I placed my TestPoint.png in the root directory of my python add-in script. Here's the function I made that is supposed to draw the points. I'm probably overlooking something obvious, but I cannot find it. Any clue?
def draw_points():
app = adsk.core.Application.get()
view = app.activeViewport
#delete all custom graphics groups
cnt = root.customGraphicsGroups.count
if cnt > 0:
for i in range(cnt):
root.customGraphicsGroups.item(i).deleteMe()
graphics = root.customGraphicsGroups.add()
coordArray = [10,0,0,-10,0,0]
pointIndices = [0,1]
coords = adsk.fusion.CustomGraphicsCoordinates.create(coordArray)
points = graphics.addPointSet(coords, pointIndices, adsk.fusion.CustomGraphicsPointTypes.UserDefinedCustomGraphicsPointType,'TestPoint.png')
view.refresh()
Solved! Go to Solution.