Community
FormIt Forum
Welcome to Autodesk’s FormIt Forums. Share your knowledge, ask questions, and explore popular FormIt topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamo CallJSAPI Visual Style Set Color

2 REPLIES 2
Reply
Message 1 of 3
chris.kepner
401 Views, 2 Replies

Dynamo CallJSAPI Visual Style Set Color

chris.kepner
Explorer
Explorer

I'm trying to make a dynamo graph that sets a visual style edge color for Formit.

I see in the Formit Plugin API that it calls for [in] color WSM.Color
What do I type in the String node connected to paramsJSON? I've tried every combination I can think of and it will not change the color!

I would love some guidance.

 

 

Set edge color.png

0 Likes

Dynamo CallJSAPI Visual Style Set Color

I'm trying to make a dynamo graph that sets a visual style edge color for Formit.

I see in the Formit Plugin API that it calls for [in] color WSM.Color
What do I type in the String node connected to paramsJSON? I've tried every combination I can think of and it will not change the color!

I would love some guidance.

 

 

Set edge color.png

Labels (1)
2 REPLIES 2
Message 2 of 3
chris.kepner
in reply to: chris.kepner

chris.kepner
Explorer
Explorer

I just found some more info on another post. Made a WSM.Color call for the SetEdgeColor call. For some reason, it's still not setting the color though.

chriskepner_0-1701299748950.png

 

0 Likes

I just found some more info on another post. Made a WSM.Color call for the SetEdgeColor call. For some reason, it's still not setting the color though.

chriskepner_0-1701299748950.png

 

Message 3 of 3

josh.goldstein
Community Manager
Community Manager

Hi @chris.kepner,

 

Glad you're trying this out! Sorry for the struggles.

 

In order to do this properly, you'll have to do some JSON and Dictionary manipulation. Basically:

  • Create a dictionary with the RGBA values (using input nodes marked as IsInput so they will show up in FormIt - see below)
  • Stringify that for the first CallJSAPI node (to create the WSM color)
  • Parse the result of that back into JSON
  • Create a new dictionary, adding the top-level "color" key
  • Stringify that and send it to the second CallJSAPI node (to modify the Visual Styles)

Looks like this in the end:

joshgoldstein_1-1701306158358.png

 

I've attached the sample graph itself for you to use.

 

Since this is a "Data Graph," when you click the thumbnail in the Dynamo panel to run it, you'll get the inputs exposed in FormIt directly, so you can adjust the colors without having the Dynamo graph editor running:

joshgoldstein_0-1701305455021.png

 

Hope this helps.

 



Josh Goldstein
Product Lead
0 Likes

Hi @chris.kepner,

 

Glad you're trying this out! Sorry for the struggles.

 

In order to do this properly, you'll have to do some JSON and Dictionary manipulation. Basically:

  • Create a dictionary with the RGBA values (using input nodes marked as IsInput so they will show up in FormIt - see below)
  • Stringify that for the first CallJSAPI node (to create the WSM color)
  • Parse the result of that back into JSON
  • Create a new dictionary, adding the top-level "color" key
  • Stringify that and send it to the second CallJSAPI node (to modify the Visual Styles)

Looks like this in the end:

joshgoldstein_1-1701306158358.png

 

I've attached the sample graph itself for you to use.

 

Since this is a "Data Graph," when you click the thumbnail in the Dynamo panel to run it, you'll get the inputs exposed in FormIt directly, so you can adjust the colors without having the Dynamo graph editor running:

joshgoldstein_0-1701305455021.png

 

Hope this helps.

 



Josh Goldstein
Product Lead

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

Post to forums  

Autodesk Design & Make Report