Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CustomGraphicsPointSet Colour property

Message 1 of 7
233 Views, 6 Replies

CustomGraphicsPointSet Colour property



I've been experimenting with rendering some point data using the CustomGraphicsPointSet. In terms of geometry it's working fine, however I don't appear to be able to change the colour of the data to anything other than bright green. It's not 100% clear from the documentation whether you can change the colour property of PointSets but it appears to suggest you can.


Below is how I create my PointSet

Ptr<CustomGraphicsCoordinates> coordinates = CustomGraphicsCoordinates::create(points);
	pointSet = cgGroup->addPointSet(coordinates, std::vector<int>(), CustomGraphicsPointTypes::PointCloudCustomGraphicsPointType, "");


And here is how I attempt to change the colour

Ptr<CustomGraphicsSolidColorEffect> solidRed = CustomGraphicsSolidColorEffect::create(Color::create(255, 0, 0, 255));
	//Ptr<CustomGraphicsVertexColorEffect> colorEffect = CustomGraphicsVertexColorEffect::create();
	bool result = pointSet->color(solidRed);


The result always appears to be "true", however the display always shows the PointSet as green.


Am I missing something or is this just a limitation of the SDK?


Thank you!



Message 2 of 7
in reply to: markchristy

For point graphics, it's best to use the user-defined type of point where you supply an image that represents the point. A user-defined point can be any color, shape, or size you want.

Brian Ekins
Inventor and Fusion 360 API Expert
Message 3 of 7
in reply to: BrianEkins

Hi Brian,


Thank you for your comment. However, using an image surely I'm limited to all points in that set using the same image? Ergo they can not be different colours, etc.. 


For example I want to create like a "height map" or "heat map" of sample points (say 1,000 points) going from red through blue to green. It "should" be trivial to do this using the "PointCloudCustomGraphicsPointType" however it appears to ignore all colour information I supply.. unless of course I've done something wrong (which is entirely possible!).


Many Thanks



Message 4 of 7
in reply to: markchristy

Hi @markchristy .


I have also used small spheres in the past because point not reflect colors.
It is easy to create a sphere using the TemporaryBRepManager.createSphere method. 


However, I have the impression that the processing of CustomGraphics is not very light, and I think that the processing becomes heavy if there is a large amount of them.

Message 5 of 7
in reply to: markchristy

Thank you @kandennti for the suggestion, however as you suggest it's not practical for many points to do this.


I guess I'm going to have to try some other "tricks" unless there is something obviously wrong with my code as to why I can't change the colour of PointSets?


Many Thanks



Message 6 of 7
in reply to: markchristy

@markchristy .


If it were me, I would look for other methods once I know it is a bug.
It would be a waste to stop development just for that.

Message 7 of 7
in reply to: markchristy



Well I've tried all sorts of tricks over the past few days. It appears the PointSet custom graphics type is pretty useless if you want to render something other than thumbnail images. Swapping to other approaches gets some results, but the performance and look is not going to be acceptable in the long run. So for now I think I just need to park this work and work on another platform sadly.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report