Automating with CATIA macro
Automating with CATIA macro
(OP)
I am a fairly comfortable user with CATIA V5, operating on V12.4.15. I am trying to write a macro that which will take a group of selected surfaces and create pads with them. Here's the hitch: the surfaces may not be named exactly the same every time this macro is run, and the number of surfaces vary, so recording is not an option. The best way I can think of to do this is to read the names of all the surfaces into an array, then using a Do loop, create a Part Body and a pad as it cycles through each array value. Therein lies the problem: I don't know how to get the macro to read names of arbitrarily named surfaces. The CATIA online documentation doesn't cover this topic, relying on recording macros as opposed to programming them. If no one knows the answer to this, maybe you'd know the name of a book of macro programming techniques that I can reference? Thanks.





RE: Automating with CATIA macro
first define in which Geometrical set you work in:
dim oHB as HybridBody
set oHB = CATIA.ActiveDocument.Part.HybridBodies.item (x)
Then get the yth element :
dim oSurface as HydridShape
set oSurface = oHB.HybridShapes.Item(y)
then check the name:
if oSurface.Name = "Random" then BINGO !
indocti discant et ament meminisse periti
RE: Automating with CATIA macro
indocti discant et ament meminisse periti
RE: Automating with CATIA macro
RE: Automating with CATIA macro