Search code examples
vbacatia

Disassemble surfaces in CATIA using VBA


Is there a way to disassemble a surface in domains in CATIA through VBA, maintaining the dependencies between the initial surface and the separated domains?


Solution

  • I can suggest 2 options, I have already employed both of them in my works in a similar way. None of them will of course be guaranteed to update after input changes, but associativity with existing domains will exist. Option 1:

    1. Pick a random face in automation using Search (within topology option in the query string. To get to the right query string, first try it using manual searches with Include Topology option active).
      1. Create two Extract with Point continuity based on this face: one will be the first domain you're looking for, the second will be in Complementary mode and the input for the next step
      2. Repeat recursively from step 1 until all domains are extracted. Last complementary extract will probably raise an error (manage it with On Error Statement)

    Option 2:

    1. Disassemble in domains getting dumb surfaces, store them.
      1. Create a point on surface on each of them
      2. Create many Near, always on the same input surface, using each of the points obtained before. If you don't like keeping relationships with dumb surfaces, insert this step after step 2: read point's coordinates using GetCoordinates method, then create another point by coordinates and use that into the Near. Then delete all dumb surfs and points created on them. Regards