Add and remove geometric faces to a Linked Named Selection

Hi!
I am working on a model in MacWay that have 41 Loads & Constraints, 11 Named Selections and 8 Configurations.
It took me lot of time to prepare all data, links in Named Selections, etc.
Now I need to make a little change in the step file to simple divide one face in two faces to apply load in only one of them.
After reload the modified step file, my model lost all Named Selected links, and now I have to redefine all Named Selection Links again.
The problem is that I don't not know how to Add or Remove geometric faces to a Named Selected Link. Is there a way to add and/or remove geometric faces to a Linked Named Selection? Or I have to delete all Linked Named Selections and create new ones and after that assign them to each of the 41 Loads and Constraints! In others words, I have to redefine everything almost from scratch. Am I doing some thing wrong? Any help will be welcome! How each of you do when you need to change something in step geometry?
Thank you very much.

Comments

  • Hello RPP.

    Unfortunately, this is currently a limitation with named selections. But there are some shortcuts to redefining everything:

    1. Don't remove or import the STEP file again. Just replace it with the new version and regenerate the mesh and it'll try to retain the linked named selections. It might get some (or all) of them wrong because the geometry has changed though.

    2. With the old named selections still there, manually recreate all the named selections that need updating and give them the same name but with a common unique suffix. For example if it was called foo, make the new one fooABC123.

    3. The next step will be easier if you delete the mesh but you don't have to.

    4. Open the .liml file in a text editor and delete all the old named selections, which look something like this
      <faceselection name="foo" visible="true">
        <geom id="1" surfaceid="20" />
        <geom id="1" surfaceid="23" />
        <geom id="1" surfaceid="6" />
        [... face definitions if the mesh is there ...]
      </faceselection>
    5. Search and replace to remove the suffixes from the new ones (eg. ABC123).

    6. Finished. Open it in Mecway and all the new named selections should still be properly linked the STEP file but now also linked to the same loads as the old ones.
  • Hello Victor!
    Thank you very much for your suggestion.
    I recreated all Named Selection with suffix "__New".
    When I opened the liml file I found a lot of Name Selections that seems not being used. I Deleted all them. As matter of fact I did not deleted manually. I created a simple C# program that delete all unused faceselection, but the faceselection that ends with "__New". After that I replaced "foo__New" to "foo". Exactly what you suggested in steps 3, 4 and 5. I create a script that calls my program and now it became much more easy to solve the problem. I will left the simple C# code for those who have same problem.
    Once more, thank you!

    using System;
    using System.IO;
    using System.Linq;
    using System.Xml.Linq;
    using System.Windows.Forms;
    using System.Collections.Generic;

    namespace UpdateSelections
    {
    static class Program
    {
    [STAThread]
    public static void Main(string[] arguments)
    {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    if (arguments.Length != 0 && File.Exists(arguments[0]))
    {
    string file = arguments[0];
    XDocument doc = XDocument.Load(file);
    var q = from node in doc.Descendants("faceselection")
    let attr = node.Attribute("name")
    where attr != null && !attr.Value.Contains("__New")
    select node;
    q.ToList().ForEach(x => x.Remove());
    q.ToString();
    var docText = doc.ToString().Replace("__New", "");
    File.WriteAllText(file, docText);
    Console.WriteLine("Success! Please, reopen file to view changes!");
    }
    else
    {
    Console.WriteLine("Error! Please, pass file path as argument!");
    }
    Console.ReadKey();
    }
    }
    }


  • Fantastic. Thanks.

    There are a lot of redundant hidden face selections that are just there so that if you add a new one from the geometry, it'll know which mesh faces it is without remeshing. It's safe to delete them like you did.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!