Changing the color of a mesh

Changing the color of a mesh

stefanome
Collaborator Collaborator
2,640 Views
4 Replies
Message 1 of 5

Changing the color of a mesh

stefanome
Collaborator
Collaborator

Is it possible to scan all the nodes of a mesh, get their coordinates, use them to perform some calculation, then set the color of the node of the mesh?

 

I want to do something similar to this, where the color shows the distance from a reference entity. I have the reference entity, I need to find the point and set the color.

 

If yes, can you please tell me where I should start investigating?

 

Here is some background:

 

I am trying to port a customization from thinkdesign (another 3D parametric CAD) to Inventor. In thinkdesign I create up to 200,000 static points, then I change their color. It is a color displacement analysis, and the color of each point gives an idea of its distance from its reference surface. My plugin allows to change the value of a parameter in Excel, which runs an Excel VBA macro which changes the parameter in the 3D model, then scans all the points and changes their color accordingly. Thinkdesign can process 20-50.000 points per second, so the feedback to the user with smaller projects is in real time, with larger projects has a little delay but it's usable.

 

Thinkdesign manages both static points and parametric points, so it was easy for me to make a such a plugin. I just used the very fast static points. No need to use meshes, points are good enough.

 

Inventor only manages parametric points inside a 3D profile, and it's impossible to import more than a few hundreds.

 

Autocad manages static points, so I tried importing an Autocad document with the static points, but Inventor changes the color of the points.

 

I tried with Recap, but I can't access the single points to change their color.

 

Now I'm thinking about using meshes, but I have never worked with meshes and I don't know where to start.

 

Thanks, Stefano

0 Likes
Accepted solutions (1)
2,641 Views
4 Replies
Replies (4)
Message 2 of 5

wayne.brill
Collaborator
Collaborator
Accepted solution

Hi Stefano,

 

Have you considered using ClientGraphics? The VBA example ZHeightColors() in the programming help does something similar to what you describe, however it does use a SurfaceBody. (calls GetExistingFacets).

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

stefanome
Collaborator
Collaborator

What programming help are you talking about?

0 Likes
Message 4 of 5

wayne.brill
Collaborator
Collaborator

Hi,

 

You can open the Inventor Programming help from Inventor. Here is a screenshot:

Inv_API_Help_Launch_WB.jpg

 

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

stefanome
Collaborator
Collaborator

I think that's exactly what I was looking for!!!

 

I can create a surface, project my points into it create a mesh and play with it. It is not going to be a real mesh, but that is enough for me.

 

I will start studying (again) the ClientGraphics. I have not used Inventor for 3 years, but I think I have already used ClientGraphics in one of my old tools.

 

The macro only creates visible stuff which is not snappable. Do you know if it is possible to create snappable entities without creating real Inventor entities? 

0 Likes