|
[Sponsors] |
[Workbench] DesignSpace Scripting: How to get Full Command Access |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 6, 2014, 05:05 |
DesignSpace Scripting: How to get Full Command Access
|
#1 |
New Member
Alexander
Join Date: May 2014
Posts: 7
Rep Power: 11 |
I have some experience in full command access in DesignModeler posted here and whant to share some more on DesignSpace (Mechanical utility).
It also support JScript through Tools->Run Macro. What is behind that? First of all see "<ANSYS>...\aisol\DesignSpace\DSPages\scripts" . Then inspect Ans.Simulation.AppletCOM.dll Ans.Simulation.ObjectsCOM.dll with "ole/com object viewer" from Microsoft Visual Studio SDK (OleView.exe) Most of definitions are there/ Te main scripting object in DesignSpace is... "DS" !! Code:
var tree=DS.Tree ;// IDSTreeRootAuto var branches = DS.Tree.Branches; // IDSCollectionAuto WBScript.Out("Tree has:" +"\nName="+tree.Name +"\nId="+tree.ID +"\nClass="+tree.Class +"\nBranches Count="+branches.Count , true); for(var i=1; i<=branches.Count;i++) { var br1=branches.Item(i); // IDSBranchAuto var proj=br1.Project; // IDSProjectAuto var model=br1.Model; // IDSModelAuto var mcgrp=br1.MeshControlGroup; // IDSMeshControlGroupAuto var csgrp=br1.CoordinateSystemGroup; // IDSCoordinateSystemGroupAuto var env=br1.Environment; // IDSEnvironmentAuto var ctgrp=br1.ContactGroup; // IDSContactGroupAuto var awset=br1.AnswerSet; // IDSAnswerSetAuto var cggrpset=br1.ComponentGroup;// IDSComponentGroupAuto WBScript.Out("Project has:" +"\nName=" +proj.Name +"\nId=" +proj.ID +"\nClass=" +proj.Class ,true); WBScript.Out("Model has:" +"\nName=" +model.Name +"\nId=" +model.ID +"\nClass=" +model.Class ,true); WBScript.Out("MeshControl Group has:" +"\nName=" +mcgrp.Name +"\nId=" +mcgrp.ID +"\nClass=" +mcgrp.Class ,true); } |
|
April 21, 2015, 10:57 |
|
#2 |
New Member
narjisse
Join Date: Apr 2015
Posts: 5
Rep Power: 11 |
Hi BaoBab,
Thank you for your post! I have a problem, I want to use some command that are described in your script but when I run my script. I have an error message: DS undefined Can you help me please! Thank you, |
|
April 21, 2015, 18:46 |
|
#3 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Minou,
You have to define DS first if you havent! Code:
var ds = WB.AppletList.Applet("DSApplet").App.Script.ds; Hope it helps Cheers KAPI |
|
April 22, 2015, 01:40 |
|
#4 |
New Member
narjisse
Join Date: Apr 2015
Posts: 5
Rep Power: 11 |
Many thanks Kapi for your answer!
When I defined DS as: var ds = WB.AppletList.Applet("DSApplet").App.Script.ds; I had an error message: WB undefined. Can you help me please Thank you, |
|
April 22, 2015, 01:48 |
|
#5 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Minou,
are you working on DesignModeler or DesignSpace(Mech Utility)? Cheers KAPI |
|
April 22, 2015, 01:51 |
|
#6 |
New Member
narjisse
Join Date: Apr 2015
Posts: 5
Rep Power: 11 |
Hi Kapi,
I am working on the DesignModeler. Thank you, |
|
April 22, 2015, 01:54 |
|
#7 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Minou,
the above code posted by Baobab is for designSpace, Please post your query on DesignModeler thread! Cheers KAPI |
|
February 9, 2018, 07:02 |
|
#8 |
New Member
Join Date: Feb 2018
Posts: 2
Rep Power: 0 |
Thank you very much!
|
|
February 9, 2018, 07:04 |
|
#9 |
New Member
Join Date: Feb 2018
Posts: 2
Rep Power: 0 |
I am new to Ansys scripting and have read a lot of your posts. You are not quite active now, but I really want to thank you. Thanks.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rotor 67 full compressor geometry | jf | Main CFD Forum | 3 | January 28, 2024 05:14 |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 16:35 |
Macro scripting in netbeans, importing star libraries | laurensvd | STAR-CCM+ | 3 | October 31, 2020 22:06 |
[DesignModeler] DesignModeler Scripting: How to get Full Command Access | ANT | ANSYS Meshing & Geometry | 53 | February 16, 2020 15:13 |
Discrepancy ensight slice and full data for parallel decomposed case | Japsor | OpenFOAM Bugs | 0 | August 27, 2013 04:47 |