|
[Sponsors] |
May 8, 2014, 12:48 |
Journaling - Create 2 Point Connector
|
#1 |
Member
Vanessa Herwig
Join Date: May 2014
Posts: 36
Rep Power: 12 |
Hi,
I have a question regarding Journaling in Pointwise. I want to create a script where I connect 2 Points with a Connector. The Journaling gives me this output: Code:
set _TMP(mode_10) [pw::Application begin Create] set _TMP(PW_68) [pw::SegmentSpline create] set _CN(8) [pw::GridEntity getByName "con-6"] $_TMP(PW_68) addPoint [$_CN(1) getPosition -arc 1] $_TMP(PW_68) addPoint [$_CN(4) getPosition -arc 0] set _TMP(con_24) [pw::Connector create] $_TMP(con_24) addSegment $_TMP(PW_68) unset _TMP(PW_68) $_TMP(con_24) calculateDimension $_TMP(mode_10) end unset _TMP(mode_10) pw::Application markUndoLevel {Create 2 Point Connector} set _TMP(mode_10) [pw::Application begin Create] set _TMP(PW_69) [pw::SegmentSpline create] set _CN(9) [pw::GridEntity getByName "con-7"] $_TMP(PW_69) delete unset _TMP(PW_69) $_TMP(mode_10) abort unset _TMP(mode_10) unset _TMP(con_24) I am not sure what the second "Application begin Create" is all about. Can anyone explain it to me what it is about and why it is importend to have it in the script. Thank you for your help. Vanessa |
|
May 8, 2014, 15:00 |
|
#2 | |
Senior Member
Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 434
Rep Power: 22 |
Quote:
The "pw::Application begin Create" function is creating a mode to create an entity. In this case a connector. A mode is analogous to entering a panel when using the GUI - think of it like a temporary working state and nothing actually changes until the mode is accepted with Ok or Apply. The "$mode end" command is used to "Apply" the changes. So every time you enter a mode (panel) while journaling, it will add the correspond Glyph mode commands. Internally Pointwise uses modes for many things. For some simple tasks, there's no requirement a mode be used. And if that operation is only carried out a few times, the effort to code up the mode may not be worth it. However, if the create or modification is being done many times, doing so within a mode can have huge performance benefits. Here's an example to explain. I want to change the dimension of a connector to a specified avg spacing. Here's how you would do it without a mode: Code:
set con [pw::Grid getByName "con-1"] set avgSpacing 0.5 $con setDimensionFromSpacing $avgSpacing Code:
set allCons [pw::Grid getAll -type pw::Connectors] set conRedimMode [pw::Application begin Modify $cons] foreach con $allCons { $con setDimensionFromSpacing $avgSpacing } $conRedimMode end -Chris |
||
Tags |
connector, create, glyph, journaling, script |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
icoFoam - Floating point exception (core dumped) | File | OpenFOAM Running, Solving & CFD | 26 | March 6, 2021 05:26 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
a reconstructPar issue | immortality | OpenFOAM Post-Processing | 8 | June 16, 2013 12:25 |
[blockMesh] Include list of points | Hikachu | OpenFOAM Meshing & Mesh Conversion | 0 | June 20, 2011 10:03 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |