0

I'm tearing my hair out trying to work with generatedpoints in draft view. I have a 3D model with points that are named in a particular way, per the picture below: point names

Then on the CATDrawing, I have generated views that show those points. if I click those points in 2D, they are named in the following manner, "GeneratedPoint (insert 3D point name here)". You can see this naming example below: 2D generated naming

Now, what I'm trying to do in VBA is run a code that will select those generated points in a view, duplicate geometry on them, and name that duplicated geometry to match the 3D point names. My problem is, I can't seem to access the "GeneratedPoint" names that show up when I click the points in 2D. Below is a snippet of my code where I'm trying to access the name of the selected points:

For j = 1 To totalcnt
    Set bSel = aDoc.Selection
    bSel.Add ActiveView
    bSel.Search "Name='*GeneratedPoint *',sel"
    
    Set nm = bSel.Item(j)
    desc = nm.Name
    desc = nm.Value.Name

Usually when I have a selection, and I make an object from one of those selections, I can access the name through selection.Item(j).Name or selection.Item(j).Value.Name, but in this case neither one works.

at the desc=nm.Name line above, it gives me a name of "CATIASelectedElement16", not the actual name I see in the status bar when I click it in the drawing. And when I use desc=nm.Value.Name it gives me "Front View", which is the name of the view these points are in. I know it's selecting the points correctly, I can see them get selected, and I can see the count on the selection object matches my number of points. What am I missing? For reference, when I run the line Set nm=bSel.Item(i), that object looks like this in the Locals window. Object in Locals window

As you can see in that picture, the object Type is DrawingView, whereas I would expect it to be a point. Does anyone have any ideas on how to access the name of a generated item in 2D? So far the only way I can interact with it at all is by using selection.Search, which will find them by name, but I have no way of then actually using the specific names of those points it found. Any insight would be appreciated!

cheeseman30
  • 3
  • 1
  • 3
  • Generative elements (e.g. projected geometry from 3d) are not accessible via a macro. – Shrotter Jun 22 '22 at 13:22
  • Well that sucks. lol I was hoping that would not be the answer. I am able to select them through search, duplicate the geometry of them, all sorts of other things, but never access the name. Sad that CATIA has made that unavailable. Thanks for the answer. – cheeseman30 Jun 22 '22 at 15:08

0 Answers0