1

I'm trying to programmatically examine catparts (containing geometry and FTAs) and isolate some surfaces and wireframe inside, using CATVBA or catvbs. My question is "how to programmatically isolate surfaces wireframe in CATVBA?" or more precisely "how to programmatically implement the isolate command?"

the long explanation

Take this example: a Flag Note attached to a surface. You have this links

FlagNote --> Surface --> Surface Construction Elements

If you "isolate" the surface, you only remove the link to its construction elements. But note that the link coming from the FTA is preserved.

FlagNote --> Surface (isolated) -/- Surface Construction Elements 

By now, I don't know a method to do this programmatically. So I decided in CATVBA to achieve the same goal by cutting/pasting the surface as result. But this is the final result

FlagNote (broken link) -/- Surface (cut/paste as result) -/- Surface Construction Elements

the link coming from the FTA is also broken, and that is the problem!

TD;DR

"how to programmatically implement the isolate command in CATVBA?"

what I tried so far

My first crude attempt was cut/pasting the HybridShapes with mode CATPrtResultWithOutLink

But this is not reliable and breaks other links (as you see in the long explanation)

I would instead use the Isolate command but I can't find the corresponding API. I also see is that the command itself doesn't work in the "power input" box nor in a VBA script like that

... sel.add myHybridShape CATIA.StartCommand "Isolate"

Federico Destefanis
  • 968
  • 1
  • 16
  • 27
  • I didn't get it what you really want to do. You wish to isolate some surfaces keeping the all the FTA annotations that links to it? – Quima Sep 28 '17 at 12:24
  • Yes @AugustoQ. The main point is "how to isolate surfaces/wireframe __programmatically?__" (and performing a "clean" isolation, without affecting any linked element, such FTAs). – Federico Destefanis Sep 28 '17 at 12:40
  • As the meaning of the 'isolate' word inplies, isolating the surface will break all links it has, however what you can do, is loop over all the FTA Annotations, check its reference surfaces and copy/paste then afterwards, it will be quite a complex script though – Quima Sep 28 '17 at 13:05
  • thanks @AugustoQ, but you should consider the links direction. In this example `FlagNote --> Surface --> Surface Construction Elements` if you isolate the surface you only break the link to its construction elements. The link __coming from__ the FTA is preserved. Using the cut/paste technique, instead of `isolate`, also breaks the FTA. – Federico Destefanis Sep 28 '17 at 15:18
  • Oh..Sorry, I have never used the Isolate command before, i though it was something like creating a Datum Element. But, Still, i don't know if there is a `Isolate` command such as the one you need on API, but you can still try to create one by yourself, – Quima Sep 28 '17 at 15:23

1 Answers1

0

Isolate works with StartCommand if you are in a workbench which supports it (Part design or GSD).

Dim wbName as string = "CATShapeDesignWorkbench"
if CATIA.GetWorkbenchId <> wbName then Catia.StartWorkbench wbName
sel.Clear
sel.Add myHybridShape
CATIA.StartCommand "Isolate"
C R Johnson
  • 964
  • 1
  • 5
  • 12