|
[Sponsors] |
July 27, 2015, 19:35 |
|
#21 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Max,
If I understand your problem correctly, you need to call excel file by below code in your JS file and then create a button or something to send the values calculated to your new simulation. Code:
var excel_file; excel_file = GetObject("C:\\Users......\\excel1.xlsm"); I hope you are calling snippet by the given names. What happens when you choose Item(2)? does it suppress the snippet you want to suppress? Cheers KAPI |
|
July 28, 2015, 03:39 |
|
#22 | |
New Member
Joakim
Join Date: Jul 2015
Posts: 14
Rep Power: 11 |
Quote:
It doesn't suppress when I call them with item. So if the snippet name is: Post, the code should be... DS.....AnswerSet.Code() ? Regards |
||
July 28, 2015, 19:36 |
|
#23 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Joxen,
Could you post your code here, so that we can have better look? If it is not suppressing with item then we have to think of different approach to pick that item. Cheers KAPi |
|
July 30, 2015, 02:48 |
|
#24 | |
New Member
Joakim
Join Date: Jul 2015
Posts: 14
Rep Power: 11 |
Quote:
Of course here comes the code with the item, this doesn't work. Code:
var SelExtMoment = DS.Tree.FirstActiveBranch.Environment.Loads.Item(16); DS.Script.changeActiveObject(SelExtMoment.ID); ListView.ActivateItem("Suppressed"); ListView.ItemValue="No"; Code:
var SelExtMoment = DS.Tree.FirstActiveBranch.Environment.Loads.Pressure(1); DS.Script.changeActiveObject(SelExtMoment.ID); ListView.ActivateItem("Suppressed"); ListView.ItemValue="No"; Code:
var SelExtMoment = DS.Tree.FirstActiveBranch.Environment.Loads.Commands(1); DS.Script.changeActiveObject(SelExtMoment.ID); ListView.ActivateItem("Suppressed"); ListView.ItemValue="No"; Code:
var SelExtMoment = DS.Tree.FirstActiveBranch.Environment.Pressure(1); DS.Script.changeActiveObject(SelExtMoment.ID); ListView.ActivateItem("Suppressed"); ListView.ItemValue="No"; |
||
July 30, 2015, 20:35 |
|
#25 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Joxen,
last 3 codes will not work cuz to pick any item in tree you have to use "Item()" So the first code you posted is valid. You say Pressure is located at position 16 but have you confirmed that when your code runs Item(16) goes to Pressure? Use a debugger and see what it is doing and what value you are getting at Item(16) that way you have your solution. Cheers KAPI |
|
July 31, 2015, 05:04 |
|
#26 | |
New Member
Joakim
Join Date: Jul 2015
Posts: 14
Rep Power: 11 |
Quote:
That's the problem, if I have my APDL-command at position 16 and pick item 15, I access the load above (of course) but if i pick item (16) which should be the next one (the APDL Command) I'll get the load after the APDL which in the tree structure is item (17). So my problem is, should I be able to handle the APDL command with item() or is there an other command to access the APDL Command Snippets? Cheers /Joxen |
||
August 2, 2015, 23:28 |
|
#27 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Joxen,
You should be able to use Item() to pick the pressure but I am not sure why it is skipping it. I am sure you have tried everything mentioned below if not then try to see - Check if the "SelExtMoment.ID" you are using is correct for the item - Is it Manually suppressing the item or giving error? - try to put something else at item(16) and see if its working. - Go to each and every line of your code and see what values you are getting at variables(check if they are empty or Null or error) Sorry mate,not able to see why it is not working! Keep trying! Cheers KAPI Last edited by Kapi; August 7, 2015 at 01:00. |
|
August 7, 2015, 05:04 |
|
#28 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
does anybody know how to change the number of imported points by scripting? Manually you can achive this by change "Point Feature Limit" (Mechanical>Tools>Options>DesignModeler>Miscellane ous) Best regards, Max |
|
August 9, 2015, 19:41 |
|
#29 | |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Max,
Just did a quick search in Help section. For coordinate files for scripting it says: Quote:
Thats my interpretation, I could be wrong tho! Cheers KAPI |
||
August 11, 2015, 08:43 |
|
#30 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi Kapi,
in default it is set to 2000 points. I just want to change it to 10000 points (this is the maximum which you can input manually). Best regards, Max |
|
August 11, 2015, 19:46 |
|
#31 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Max,
I understand it is set to 2000 but as per my previous post, I think you will not be able to change it with scripting! Anyways, try to do this Open workbench, change number of points to 10000, save it, close it. Open new session of workbench, go to settings and see if its 2000 or 10,000. If its 10,000 then use your script normally ,it shall pick 10K. If its still 2000 then I cant help you, sorry Cheers KAPI |
|
August 20, 2015, 05:21 |
|
#32 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
I found the following code but actually on't know how to use it: Code:
ag.m.PointFeatureLimit Code:
ag.m.PointFeatureLimit = 3000; Best regards, Max |
|
September 21, 2015, 04:30 |
Select body in Mechanical by scripting
|
#33 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
does anybody know how to select a body in Mechanical (Workbench) by scripting? I have two bodies and need to select the first one. Best regards Max |
|
September 25, 2015, 10:19 |
|
#34 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
does anybode know how to delete a mechanical solution (totalDisplacement) by script? Best regards, Max |
|
Tags |
ansys, mechanical, mesh, model, script |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Atomization and Breakup model | xck1986 | OpenFOAM | 4 | May 31, 2014 05:43 |
manualInjection model in sprayFoam | Mentalo | OpenFOAM Running, Solving & CFD | 1 | April 2, 2014 10:29 |
Mixture model + VOF? | blacksoil2012 | Fluent Multiphase | 2 | February 9, 2014 00:59 |
eddy dissipation model: combustion doesn't occur | roukaia | FLUENT | 0 | December 24, 2011 10:10 |
Problems bout CFD model of biomass gasification, Downdraft gasifier | wanglong | FLUENT | 2 | November 26, 2009 00:27 |