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 |
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 |
Quote:
do you know how to use the FaceSplit function? I already managed to insert "Split Face": Code:
ag.gui.CreateFaceSplit(); Best regards, Max |
sorry mate, no idea
|
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 Max |
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 |
thank you .. this one helped me a lot! :)
Best regards, Max |
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 |
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); Best regards, Max |
Select Vertices by scripting
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); Max |
Create Projection
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. |
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? |
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 |
Thanks for your Information ,Kapi.
If I have any question more, please help if you can . :) Best Regards, Allen |
sure mate, we are here to help each other
|
Specific Python Script+Ansys Workbench
1 Attachment(s)
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,Attachment 49801 |
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? |
Check this Link as well
|
Thank you so much! Kapi
I have read these books. I am a new user to Python. I have a question again. :D how to open .bat file by running python script(command lines)? Can someone have an idea with that? |
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 |
All times are GMT -4. The time now is 01:08. |