SimplifiedLogic / creoson

OpenSource Automation using JSON Transactions for PTC's CREO Parametric
http://www.creoson.com
MIT License
79 stars 23 forks source link

Delete Feature based on feat_id #71

Closed DieSwartKat closed 3 years ago

DieSwartKat commented 3 years ago

Hi Guys

I'm making use of the Feature: delete function in CREOSON, but this is only possible for features which have names. This is the result when I run the Feature List function:


[
    {
        "status": "ACTIVE",
        "name": "SIDE",
        "type": "DATUM PLANE",
        "feat_id": 16
    },
    {
        "status": "ACTIVE",
        "name": "TOP",
        "type": "DATUM PLANE",
        "feat_id": 18
    },
    {
        "status": "ACTIVE",
        "name": "FRONT",
        "type": "DATUM PLANE",
        "feat_id": 20
    },
    {
        "status": "ACTIVE",
        "name": "CS0",
        "type": "COORDINATE SYSTEM",
        "feat_id": 30
    },
    {
        "status": "ACTIVE",
        "name": "",
        "type": "WALL SURFACE",
        "feat_id": 548
    }
]

I have to renaming feature 548 first before I can delete it as the feature delete function only takes names.

Would it be possible to also accept feature id's in the feature delete function, or have a separate function which accepts feature id's?

davidhbigelow commented 3 years ago

To encourage better design automation .... we recommend named features.

A workaround would be to record and run a mapkey to perform this operation. Swapping the mapkey's ID with your ID just prior to execution.

Dave

On Fri, Jul 30, 2021 at 11:12 AM DieSwartKat @.***> wrote:

Hi Guys

I'm making use of the Feature: delete function in CREOSON, but this is only possible for features which have names. This is the result when I run the Feature List function:

[ { "status": "ACTIVE", "name": "SIDE", "type": "DATUM PLANE", "feat_id": 16 }, { "status": "ACTIVE", "name": "TOP", "type": "DATUM PLANE", "feat_id": 18 }, { "status": "ACTIVE", "name": "FRONT", "type": "DATUM PLANE", "feat_id": 20 }, { "status": "ACTIVE", "name": "CS0", "type": "COORDINATE SYSTEM", "feat_id": 30 }, { "status": "ACTIVE", "name": "", "type": "WALL SURFACE", "feat_id": 548 } ]

I have to renaming feature 548 first before I can delete it as the feature delete function only takes names.

Would it be possible to also accept feature id's in the feature delete function, or have a separate function which accepts feature id's?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SimplifiedLogic/creoson/issues/71, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJNUQ2ZDXNH4YG22B7DT2K6PXANCNFSM5BIW2KIQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

DieSwartKat commented 3 years ago

Thanks David

I agree that this is best practice, and therefore agree with your position. My use case is a little different because I'm trying to delete the FLAT PATTERN feature, which there can only be a single one off. Plus, if I have to delete features by their name, i'm using the rename function first which is using the feat_id to find it, and then delete that feature based on it's name.

Mapkey: I've recorded the fastest possible mapkey, but it doesn't show the feat id in it, but rather the node position. I'll therefore have to record it using a search function to find the feature and then delete it base on the selection.

mapkey(continued) ~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node13`;\
mapkey(continued) ~ Command `ProCmdEditDelete` ;~ FocusIn `del_sup_msg` `ok`;\
mapkey(continued) ~ Activate `del_sup_msg` `ok`;

Would it be an easy addition to add the node position in the feature : list function?

davidhbigelow commented 3 years ago

Just a hunch ... what about recording a Mapleton that uses the find dialog and filter by maybe type?

On Sat, Jul 31, 2021 at 05:29 DieSwartKat @.***> wrote:

Thanks David

I agree that this is best practice, and therefore agree with your position. My use case is a little different because I'm trying to delete the FLAT PATTERN feature, which there can only be a single one off. Plus, if I have to delete features by their name, i'm using the rename function first which is using the feat_id to find it, and then delete that feature based on it's name.

Mapkey: I've recorded the fastest possible mapkey, but it doesn't show the feat id in it, but rather the node position. I'll therefore have to record it using a search function to find the feature and then delete it base on the selection.

mapkey(continued) ~ Select main_dlg_cur PHTLeft.AssyTree 1 node13;\ mapkey(continued) ~ Command ProCmdEditDelete ;~ FocusIn del_sup_msg ok;\ mapkey(continued) ~ Activate del_sup_msg ok;

Would it be an easy addition to add the node position in the feature : list function?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/SimplifiedLogic/creoson/issues/71#issuecomment-890319065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMSRJP5K7HOXTQXI3M4BHDT2O657ANCNFSM5BIW2KIQ .

-- David Bigelow, President Simplified Logic, Inc https://www.simplifiedlogic.com | SimilarParts.ai C: 317-431-5454

DieSwartKat commented 3 years ago

Yes, but that is a lot slower to run. Anyway I'm trying my luck.

Thanks for responding.