How to change color of SketchPoint in VBA?

How to change color of SketchPoint in VBA?

bshbsh
Collaborator Collaborator
332 Views
2 Replies
Message 1 of 3

How to change color of SketchPoint in VBA?

bshbsh
Collaborator
Collaborator

Hi,

as the title says. How do I do that?

I can right click points and chnage their color, but I didn't find any color or similar property of those.

0 Likes
333 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @bshbsh.  Though the Sketch itself has properties defined in the API like Color, LineType, & LineWeight, most individual entities within do not have those properties exposed in the API yet.  But most individual entities to have the Layer property that can be used to help control some of these aspects, in a round about way.  Although the 'Properties...' command ("LinePropertiesCtxCmd"), as seen in the right-click menu can be launched/executed from code, it remains a UI (user interface) tool, so it is very difficult to navigate from a code standpoint.  I don't think we actually have an API method equivalent to that yet for changing the properties of individual sketch entities.

Out of curiosity though, why would you want to change the color of a sketch point?  Is this in the context of a drawing document and a DrawingSketch, instead of a PlanarSketch in a Part or Assembly?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

bshbsh
Collaborator
Collaborator

@WCrihfield wrote:

 

Out of curiosity though, why would you want to change the color of a sketch point?  Is this in the context of a drawing document and a DrawingSketch, instead of a PlanarSketch in a Part or Assembly?


I'm plotting (literally, making lots of points) three "curves" of a mechanism, on an assembly sketch (hence Sketchpoint, not sketchpoint2d), such as acting torque and applied torque and angle, speed, vs hub of the actuator, and it would be nicer to have different colors for the "curves".

Well if there's no API for that, I could just make three overlaing sketches for the three curves, and set their color manually, it needs to be done only once.

Clipboard01.jpg

edit:

it sorta works... but once i delete the old points, the sketch resets to no color, and the color can not even be set if the sketch does not contain anything. so i have to apply the different colors for all sketches after every plot run.

Clipboard02.jpg

0 Likes