Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to select shape by its ID in jscript (Read 3173 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
how to select shape by its ID in jscript
Apr 15th, 2012 at 11:05am
Print Post  
scripthelper.getShapes().get(int) works, but I want to reference by its ID (ie "roundedrect")
What is the syntax for that ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to select shape by its ID in jscript
Reply #1 - Apr 16th, 2012 at 6:37am
Print Post  
scriptHelper.shapeFromId("RoundRect");

Also here is a reference for the ScriptHelper class, it might help in other situations too:
http://www.mindfusion.eu/onlinehelp/jdiagram/index.htm?T_com_mindfusion_diagramm...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: how to select shape by its ID in jscript
Reply #2 - Apr 17th, 2012 at 9:57pm
Print Post  
Thanks,
I'll look better next time. Smiley

I did used that helpfile but was looking at the wrong place (shapelist-members)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to select shape by its ID in jscript
Reply #3 - Apr 18th, 2012 at 6:11am
Print Post  
If you were programming in Java, you would use the static Shape.fromId method actually. But since static methods and constructors are not accessible from JavaScript (for classes that are not on the system class_path), we have to add equivalent methods to ScriptHelper.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint