1

I want to automatically insert some STL objects to a geometrical set.

Without a macro I open “STL Rapid Prototyping” and use “STL import”.

I am trying to do several adjustments faster by automation and therefore I need to avoid this manual step. I tried to record this procedure but the result is useless for me.

Is there a way to import an STL to a geometrical set with a (VBA) macro?

(Usually, I work with Generative Shape Design and use VBA for Macros)

Community
  • 1
  • 1
Christina
  • 13
  • 4

2 Answers2

1

Sorry but there are no APIs to perform the "Import STL" function on the STL workbench.

As far as I know the only way to automate this task are to use WINAPI methods; that is simulating window/mouse/keyboard interaction using window handles and Windows messages. I have done exactly this task not too long ago. It is not difficult, it is just tedious.

C R Johnson
  • 964
  • 1
  • 5
  • 12
  • Thank you for your answer :). I don't know how to use WINAPI methods but I'll try it out if I have a little more time. – Christina Jan 16 '20 at 21:45
0

There is a method to do it, but it fails sometimes:

  1. Open the STL in a Assembly (Insert / Existing-component)
  2. Switch to the DMU-Optimizer Workbench
  3. Create an Zero-Offset to the part (Offest function with value 0)
  4. Save the model as *.model (that is a CATIA V4 file-format)
  5. Open the *.model file
  6. Navigate the Tree and select&copy all faces
  7. Open a NEW Catia(V5) Part and paste all faces

sometimes this works perfect, sometimes it crashes (on larger files) or it is missing some faces.

Hu gePanic
  • 90
  • 6