2 Replies Latest reply on Feb 9, 2009 11:50 PM by 1-34CXKG

    CosmosWorks Macro help

    Brendan L
      Hello all,
      I am trying to write a macro that gets a tip deflection on a wing structure with a given loading case. My thought process is that I need to obtain the nodes of the face at the tip of the wing and find the deflection at it. This led me to use the function: CWMesh->GetElementDataFromEntity . In trying to use this, I input a dispatch pointer to the entity of the face at the tip (from the SW model). The return for this is a NULL pointer.

      Main Question:

      Is there a difference in the type of entity that I am supposed to use as an input? Is it the SolidWorks entity?
        • CosmosWorks Macro help
          Anthony Botting
          Hello Brendan: I'm not a programmer but you may find an alternate approach is useful. Maybe the API will have an extraction command for this. (Note: I teach this "non-zero restraint" method in Simulation class): if you need to know the force required to hold something in position, just apply a non-zero restraint to the value that you want, run the analysis, then read the Reaction on the restraint. It will report the force required to hold it there. Example on cantilever beam. Put a 1" displacement constraint on the end face of the beam, in a direction perpendicular to the length so as to bend the beam. Run. Right click on the Results folder and find a "Reaction" item or "List Results Force" in the new Simulation 09 interface. You can click on the end face of the model (where the non-zeros restraints were applied) and get the reaction force required to hold it there.
          • CosmosWorks Macro help
            Hi Brendan,

            Maybe you already know this and are looking for a way to repeat it many times with less effort, but you don't need a macro to find the deflection at your wing tip. Starting with a deflection plot, use the result tool "probe" to click on nodes and find out the local deflection numerically. These values and locations can also be saved as sensors and attached to the plot so that they always display. Once you have it set up how you like it you can copy your plot to multiple studies by dragging or by duplicating your study.

            Hope this helps,