|
[Sponsors] |
[DesignModeler] DesignModeler Scripting: How to get Full Command Access |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 26, 2015, 06:31 |
|
#21 |
Member
Join Date: Oct 2011
Posts: 36
Rep Power: 15 |
Hi KAPI,
thanks for your fast reply, but unfortunately, it's not working. Any other ideas? Otherwise, I'm gonna try it from within Ansys Meshing. Best regards, Victor |
|
May 26, 2015, 19:28 |
|
#22 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
Hi Victor,
I have used similar code with bodies and it worked, possible that they have some different code for selecting faces. I got no other idea to select NS except below code(working code for body) Code:
agb.AddSelect(agc.TypeBody, NamedSelect1); Cheers KAPI |
|
August 11, 2015, 11:07 |
|
#23 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
do you know how to use the FaceSplit function? I already managed to insert "Split Face": Code:
ag.gui.CreateFaceSplit(); Best regards, Max |
|
August 12, 2015, 22:01 |
|
#24 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
sorry mate, no idea
|
|
August 19, 2015, 07:44 |
|
#25 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
I want to change the ModelTolerance (Designmodeler>Units>Model Tolerance>Tight. I found the following in the "agConstants.js" Script: Code:
ag.c.ModelTightTol = ag.m.constant("MODEL_TIGHT"); Just copy and past the code into my code doesn't work: Code:
# encoding: utf-8 SetScriptVersion(Version="15.0") template1 = GetTemplate( TemplateName="Static Structural", Solver="ANSYS") system1 = template1.CreateSystem() geometry1 = system1.GetContainer(ComponentName="Geometry") geometry1.Edit() geometry1.SendCommand(Command = """ ag.gui.NewFile(); ag.m.ClearAllErrors(); ag.m.NewSession (true); ag.gui.setUnits(ag.c.UnitMillimeter, ag.c.UnitDegree, ag.c.No); ag.c.ModelTightTol = ag.m.constant("MODEL_TIGHT"); """) Max |
|
August 19, 2015, 08:21 |
|
#26 |
Member
Join Date: Oct 2011
Posts: 36
Rep Power: 15 |
Hey Max,
as far as I can remember (not entirely sure though) the following code snippet should do the trick Code:
ag.m.ModelPrefs.ModelToleranceType = ag.c.ModelTightTol; Victor |
|
August 19, 2015, 08:24 |
|
#27 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
thank you .. this one helped me a lot!
Best regards, Max |
|
August 20, 2015, 05:48 |
|
#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" (Designmodeler>Tools>Options>DesignModeler>Miscell ane ous) I found the following code: Code:
ag.m.PointFeatureLimit I've tried to do this: Code:
ag.m.PointFeatureLimit = 3000; Max |
|
September 1, 2015, 11:25 |
|
#29 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
I have a quite simple question, I guess: I want to create 2 Points with X,Y,Z in DESIGNMODELER for a FaceSplit feature (I want to AddSelect this 2 Points). 1. How can I create 2 simple Points? I've already managed to insert Points from CoordinateFile but I struggle to insert this 2 points now - I've tried this code, but no point appears in the tree: Code:
var Pt1 = agb.FPoint(agc.FPointConstruction,agc.FPointManual); 2. When I want to AddSelect one of my construction points from the coordinateFile instead, the following code doesn't work (nothing happens): Code:
var Point1 = GetPoint(1,1); agb.AddSelect(agc.TypeFPoint,Point1); Best regards, Max |
|
September 3, 2015, 04:09 |
Select Vertices by scripting
|
#30 |
Member
Max
Join Date: May 2015
Posts: 48
Rep Power: 11 |
Hi,
is there any possibility to select the vertices in Designmodeler by scripting? This one doesn't work : Code:
var Vertice1 = ag.m.ModelVertices(1); agb.AddSelect(agc.TypeVertice,Vertice1); Max |
|
June 27, 2016, 14:52 |
Create Projection
|
#31 |
New Member
Lainu
Join Date: Jun 2016
Posts: 1
Rep Power: 0 |
Dear All,
I'm trying to use javascript to automatize a Design Modeler Geometry. Following this post, I've manage to write a significant part of it. But now, I need to use the command Projection( type: edges on face, direction vector: none, imprint faces: yes and extend edges:No). and, frankly, I don't know how. Making some research I've found this with OLECOM viewer : [id(0x00000107), helpstring("method CreateProjection")] HRESULT CreateProjection([out, retval] IDispatch** piProjection); and the command: ag.gui.CreateProjection() But I don't know how to define the inputs of these functions. I made use of name selection in edges and faces. Maybe it could be easier using names instead of edge and face IDs. Have you ever used projection command by javascript? Could you provide me with an example? Thank you very much in advance for your help. |
|
July 25, 2016, 03:22 |
|
#32 |
New Member
Aung Ko Latt
Join Date: Jul 2016
Location: Germany
Posts: 12
Rep Power: 10 |
Hello there,
I would like to ask for some Information about python Scripting tutorials or useful documents that can help for my Thesis. The python script I would like to write is for the Automation of creation of 3D model. the 3D geometry has been developed and created by manually in Designmodeller. And the steps for creation are always the same. But some parameteters will Change. So, I would like to write a python script to do all the steps that has been created in DM with another Parameters. Do you know how can i write it? or any useful tutorial where i can find out? |
|
July 28, 2016, 03:03 |
|
#33 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
I dont have any tutorial for it but you can use "help" section in Ansys as they have examples.
Also you can search thru the threads on this website and you will get lot of information |
|
July 29, 2016, 05:32 |
|
#34 |
New Member
Aung Ko Latt
Join Date: Jul 2016
Location: Germany
Posts: 12
Rep Power: 10 |
Thanks for your Information ,Kapi.
If I have any question more, please help if you can . Best Regards, Allen |
|
July 31, 2016, 19:42 |
|
#35 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
sure mate, we are here to help each other
|
|
August 10, 2016, 07:52 |
Specific Python Script+Ansys Workbench
|
#36 |
New Member
Aung Ko Latt
Join Date: Jul 2016
Location: Germany
Posts: 12
Rep Power: 10 |
Hello Dear all,
Good Afternoon! I would like to request for help from you all. If someone can help me, I would be really glad. I am stuck on this thing. I will mention about what I would like to do. And you all can give me your suggestion or opinion or commands for this. It is about Python script for AnsysWorkbech. Let me tell you details. The description below is what I would like to do; "In AnsysWorkbench, I created the geometry domain . In this domain, I created the geometry. And then I took out the Input Parmaters as Parameter Set. In that Parameter Set, there are variable parameters than can change some parts of geometry. And then I have Excel Sheet outside of the AnsysWorkbench. In this Excel Sheet, I have the table of the variable parameters as the same as Parameters (in AnsysWorkbench Parameter Set). And then I would like to write a python script file in my computer. When I run that python script, the following work has to be done automatically; 1-The Workbench file should be open automatically 2-The variable parameters from Table of my excel sheet should be placed automatically Input Parameters (in the Parameter Set) in Workbench 3-The edited geometry should be done in Geometry Domain." or may be there is another input type for variable can be done. "In AnsysWorkbench, I created the geometry domain . In this domain, I created the geometry. And then I took out the Input Parmaters as Parameter Set. In that Parameter Set, there are variable parameters than can change some parts of geometry. And then I have .txt file outside of the AnsysWorkbench. In this text file , I have variable parameters as the same as Parameters (in AnsysWorkbench Parameter Set). And then I would like to write a python script file in my computer. When I run that python script, the following work has to be done automatically; 1-The Workbench file should be open automatically 2-The variable parameters from .txt file(text file) should be placed automatically Input Parameters (in the Parameter Set) in Workbench 3-The edited geometry should be done in Geometry Domain." Thanks for giving your time to read and answer this. I am stuck in this. And please kindly find the attached document to know my workflow in Ansys Workbench Best Regards,Workbench View.jpg |
|
August 10, 2016, 19:57 |
|
#37 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
hey mate,
I suggest you to first go thru few tutorials of DM and Mesh and look up scripting in help section of Ansys look up scripting on this website look up how to create script in Ansys on google something like this Link Once you are done with this, you will have good clue what to do!! reading and reading and understanding can only help in scripting!! Do you have some basic knowledge of Python? |
|
August 16, 2016, 15:16 |
|
#39 |
New Member
Aung Ko Latt
Join Date: Jul 2016
Location: Germany
Posts: 12
Rep Power: 10 |
Thank you so much! Kapi
I have read these books. I am a new user to Python. I have a question again. how to open .bat file by running python script(command lines)? Can someone have an idea with that? |
|
August 16, 2016, 20:15 |
|
#40 |
Senior Member
Join Date: Apr 2014
Location: Melbourne
Posts: 584
Rep Power: 14 |
post below line in your .bat file and it should open your .WBJN file!
Code:
"C:\Program Files\ANSYS Inc\v160\Framework\bin\Win64\RunWB2.exe" -I -R project1.wbjn |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rotor 67 full compressor geometry | jf | Main CFD Forum | 3 | January 28, 2024 06:14 |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 17:35 |
Physical size of geometry in DesignModeler | Michael Rasmussen | CFX | 9 | June 16, 2017 04:27 |
[DesignModeler] find features of Gambit in DesignModeler | code_source | ANSYS Meshing & Geometry | 13 | April 30, 2014 08:33 |
[Other] exchange of parameter values between TurboGrid and DesignModeler in Workbench | la7low | ANSYS Meshing & Geometry | 2 | February 21, 2011 16:12 |