Cannot scope Named selections for a Path Construction Geometry

Member Posts: 42
10 Comments First Anniversary 5 Likes Name Dropper
**
edited June 2023 in Structures

Hi guys.

An easy one for you. I am trying to scope a named selection to a path. I am using :

pth.Location = ExtAPI.DataModel.GetObjectById(WeaverEdge_NS.ObjectId)

This changes the Scoping method to Namedselection but does not populate the Named selection field.

and the pth.location remains [] when I audit during debug.

I manually created the path and inspected the properties, Next I tried populating all the properties similarly to the one I created but no success. I feel like there is more involved when named selections are involved.

Any help is appreciated.

Cheers

Answers

  • Member, Moderator, Employee Posts: 479
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭

    Hi @Kev, you need to create a selection manager object with geometric entities and then scope that to path.

    1. tempSel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
    2. tempSel.Ids = WeaverEdge_NS.Ids
    3. path.PathType = PathScopingType.Edge
    4. path.Location = tempSel


  • Member Posts: 42
    10 Comments First Anniversary 5 Likes Name Dropper
    **

    Thanks @Ayush Kumar :) The method you are proposing uses geometry selection as the scoping method. I wanted to have the scoping method as named selection. I managed to find the issue. my code was picking up the wrong named selection object due to a typo and the wrong named selection item had the wrong object type in it (body as oppose to edge).

    But all good now :)

    Thanks for all the great work

Welcome!

It looks like you're new here. Sign in or register to get started.