|
[Sponsors] |
[DesignModeler] find features of Gambit in DesignModeler |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 31, 2011, 04:41 |
find features of Gambit in DesignModeler
|
#1 |
New Member
fatma
Join Date: Jan 2011
Posts: 9
Rep Power: 15 |
Hello
I am a new user of DesignModeler, I always worked with Gambit. I have a geometry that I did with Gambit (.jou) and I want to reproduce it in DesignModeler. I have some difficulties which block me : 1 / How to move, union and subtract volumes (features "move", "unite" and "subtract" in Gambit)? 2 / How to reproduce: Code:
edges round "edge.1" "edge.2" radius1 0.002 volume blend edge create project "edge.2" face "face.1" vector 0 0 1 face create skin "edge.12" edge.21 "directions 0 0 face split "face.10" connected keeptool face "face.29" smooth face Thank you a lot for your help |
|
January 31, 2011, 09:21 |
|
#2 | |||
Member
Join Date: Jun 2010
Posts: 44
Rep Power: 17 |
Quote:
Quote:
Quote:
Projection is under the tools menu. Face split is under the tools menu. |
||||
January 31, 2011, 09:42 |
|
#3 |
New Member
fatma
Join Date: Jan 2011
Posts: 9
Rep Power: 15 |
thank you (sac) very much for your reply, it helped me a lot.
Do you have a DM Training that you advise me? |
|
February 1, 2011, 10:29 |
|
#4 | |
Member
Join Date: Jun 2010
Posts: 44
Rep Power: 17 |
Quote:
http://www.ansys.com/Support/Training+Center |
||
April 7, 2011, 14:47 |
|
#6 |
New Member
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 15 |
Can I do boolean operation by python scripting?
|
|
April 8, 2011, 10:12 |
DM is persistent, no script needed.
|
#7 |
Senior Member
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47 |
Do you mean a geometry operation?
Python is for the schematic, within each application you must use the scripting method of the application. If you are talking about doing a Boolean in DesignModeler, then you would do it the way DM does it... With persistence instead of a script. In other words, you don't need a script... Just do it in DM and if you later make upstream adjustments, DM can still update and perform the Boolean, just like a script would. Best regards, Simon
__________________
----------------------------------------- Please help guide development at ANSYS by filling in these surveys Public ANSYS ICEM CFD Users Survey This second one is more general (Gambit, TGrid and ANSYS Meshing users welcome)... CFD Online Users Survey |
|
April 8, 2011, 11:22 |
|
#8 |
New Member
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 15 |
Thanks for reply, Simon.
I really need to do a script with boolean operation in DM. My script is wrote in python, and it reads a file of many circles and one box (2D). My geometry is complex, and I need to cut the circles of the box. So, I have to use the substract operation. I can load the box and circles by a script, and I can cut them by mouse selection (menu, boolean operation set). However, I still don't know how make all proccess automatically through a script. I need to do that because my analysis requires many samples. Each sample is made of many circles. So, that proccess could speeds up my work. |
|
April 8, 2011, 11:43 |
|
#9 |
Senior Member
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47 |
Sorry, I don't know.
__________________
----------------------------------------- Please help guide development at ANSYS by filling in these surveys Public ANSYS ICEM CFD Users Survey This second one is more general (Gambit, TGrid and ANSYS Meshing users welcome)... CFD Online Users Survey |
|
July 24, 2011, 08:22 |
|
#10 |
New Member
Rohit Vasudevan
Join Date: Feb 2011
Location: Southampton
Posts: 9
Rep Power: 15 |
Hey Dibetao... U can make the process automatic by using a Javascript... For the circle sketches u can simply make Design Modeler write out sketches of active planes. While for the operation u need simple bits of code like this:
var XYPlane = agb.GetXYPlane(); agb.SetActivePlane(XYPlane); var ps1 = planeAirfoilRoot (new Object()); var plane1 = agb.PlaneFromPlane(XYPlane); plane1.AddTransform(agc.XformZOffset, 0.50); agb.Regen(); agb.SetActivePlane(plane1); var ps2 = planeAirfoilTip (new Object()); var ext1 = agb.Skin(agc.Add,agc.No,0.0,0.0); ext1.AddBaseObject(ps1.Sk1); ext1.AddBaseObject(ps2.Sk2); agb.Regen(); This bit of code Skins/Lofts two sketches... I suggest u link up Design Modeler to a debugger... Heres a link which might be useful: http://www.padtinc.com/blog/post/201...ing_Part4.aspx Best of luck |
|
October 16, 2011, 16:01 |
|
#11 |
Member
Nathan
Join Date: Aug 2010
Posts: 62
Rep Power: 16 |
@ Dibetao
I have a similar problem in 3D. I'm trying to cut a packing of particles inside a box and mesh the remaining pore space. Do you have any advice on the implementation of this. how do you proceed with the subtraction in the gui. Cheers Pal! |
|
October 16, 2011, 20:17 |
|
#12 |
New Member
Roberto Lima
Join Date: Apr 2011
Location: Ceará, Brazil
Posts: 3
Rep Power: 15 |
@ Natantyt
I didn't find any solution for this problem using the DM (Design Modeler - Ansys 13.0). I miss GAMBIT because of its pleasant journal file (looks like a script). But the Gambit was discontinued by the Ansys team If you find some solution for this question/problem using the DM, please, share with us here in the forum. ps: @rohit_8481 wrote something about this problem. However I didn't do yet. |
|
July 23, 2012, 13:21 |
|
#13 | |
New Member
Join Date: Jun 2012
Posts: 17
Rep Power: 14 |
Here is the issue with this. The actual source code for these functions is (I think...) programmed in C, so they cannot be accessed directly in DesignModeler through JScripts.
However. The interface in DesignModeler, including all the clickable buttons/menus, is being generated/drawn through Javascript, which is necessary for it to function with various languages etc. without having its entire source code rewritten -- for example, if an internal function is called "CONCEPT_GIRAFFE," then they can simply use JavaScript to assign it one of many translated Strings for display in the GUI depending on the user's installation language, and when the user clicks the translated label/button, have it simply create an Event in the EventHandler that calls CONCEPT_GIRAFFE itself without depending on anything in the GUI. Similarly, someone can be programming some SAVE_USER_FILE function and program any user file selection errors to throw an exception, while the GUI/language localization team can then take the identifier of those exceptions and write translations for them that cause the resulting message to be displayed in the user's specified language ("Cannot save file to floppy drive," "Buenos dias no habla espaniol," "Je peux pas l'ecrire sur le fromage petit," etc.). By nature of this fact, thankfully, our scripts in DesignModeler can hook into this Javascript frontend, and basically be glorified button pushers that still serve a pretty useful/effective automation routine. Problem is, with all of these functions that aren't defined in the DesignModeler Help "Scripting API" documentation, you don't have access to the functions but simply the buttons that call these functions, so programming here gets a bit creative due to the extreme lack of documentation of anything beyond the 8 simple functions listed in the Help. And by "undocumented" I mean that I haven't seen this discussed absolutely anywhere except in the context of Mechanical APDL & Workbench JScripting, which is quite different from what we need in the much-more-sandboxed DesignModeler (at least in Workbench you can record a Journal, where it stores the commands for everything you do interactively). However, using the DesignModeler's Help documentation on Scripting API as a reference to the JScript functions that you need is similarly useful to using the bible as an engineering handbook; it mentions some things that supposedly happen but doesn't describe how, it references some other things but doesn't explain how they got there, and when you try to do what it says the results usually end up skewed or backwards altogether. In any case, as I mentioned in another post here, I was doing some searching through the ANSYS .js files for function names similar to the ones in the Help documentation to see if I could find some more of them, when I read this very intriguing line in the file agInterop.js: Quote:
Note also that the quoted snippet above is also found in the file agMenu.js, and throws an event when the "File > Run Script" Menu item is clicked by a user in DesignModeler, except this one has the added comment: "//Change of plans! Let's run the Begin/End user script function here so it does not need to be in user scripts!" This is a good programming decision, because then the user is not awkwardly presented with any "ag.m.__________" commands at the top of their script file when the ANSYS guys are trying to sandbox JScripting in DM to "agc" and "agb" only. I don't at all mean that ANSYS is trying to keep users in the dark about these added functions, since it's probably a good idea: having "full access" to the scripts is not the best thing since it would mean they'd have to somewhat support it, and using these scripts to hook into UI elements is somewhat like building a keyboard-controlled robot whose main function is to type on a keyboard. They're somewhat difficult to control with JScript alone, without proper access to the C++ backend, by my view is, if it's there, why not use it to speed things up a bit. Now, to get to the point about booleans, there is a command in agEventHandler.js that response to the event thrown by clicking on the Boolean button and then clicking Generate immediately after. In fact, all of the "ag.gui.xxxxxxxxx()" functions that I've tested behave this way; they run and then self-Generate immediately. When dealing with "agb.xxxxxxx" functions, you'd have to type the "agb.Regen()" method after every new Concept/Sketch/etc. that you scripted but I forgot to add the "Regen()" when using the "ag.gui.xxxxxxxxx()" methods and they worked fine. Anyways, the command is here: ag.gui.CreateBoolean(); If you open up notepad to a blank document, paste that command in, save the document with any funky name you want but with the .js extension, then go into DesignModeler and select File > Run Script, and then browse for the file and click Open, you will see that a Boolean has been created in your Tree Outline. However, this Boolean object has nothing assigned. If you have a selection of bodies generated beforehand (I don't know how to select bodies yet, only lines & points) it will probably assign the default Unite operation and then quickly Generate itself, but there should be a way to pseudo-click the "Operation" field and select Difference, and there should definitely be a way to select Bodies (easiest way is likely through the Tree Outline, but I'll need to do some more snooping). I am currently checking around for how to access the events thrown when a user clicks within the Details View so I can quickly assign the "Operation," "Target Body," and "Tool Bodies settings", but for now this post has gotten long enough. P.S. If anyone else has been looking through anything I've mentioned in this post, please let me know. I'm not exactly Alan Turing here, so any help would be appreciated. Edit: One selection function is: agb.AddSelect(type, item); where "type" is in the form of a constant from agConstants.js (e.g. ag.c.TypeVertex) and a way to assign a selected body to a variable is to use: var body = ag.m.SelectionMgr.GetSelectedBody(); Also useful for getting various parameters are: ag.m.SelectionMgr.getSelListSize(); //Gets number of items that are currently selected Last edited by ANT; July 23, 2012 at 16:03. |
||
April 30, 2014, 08:33 |
|
#14 |
New Member
Join Date: Feb 2014
Posts: 2
Rep Power: 0 |
Hello ANT,
have you made any progress with the boolean command. I'm especially interested in creating a boolean operation (substract) with one target body and multiple tool bodies. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |
Gambit via X11 | Josh Kjenner | FLUENT | 1 | January 24, 2006 20:21 |
Creatingfan blade profile in GAMBIT | Jenny | FLUENT | 5 | April 28, 2005 06:52 |
Gambit batch - kill "Startup" box how? | Chris Bailey | FLUENT | 2 | February 23, 2005 10:05 |
Illegal segmentation error in gambit | Rob | FLUENT | 1 | February 21, 2005 08:31 |