Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Appearance

Hello

Is there a keyboard command in Onshape to set the appearance of a part to transparency 50% and back?
Is there another quick way?

Thank you for your answer(s)
Hansjürg

Answers

  • S1monS1mon Member Posts: 3,100 PRO

    50%? No, but shift-T will make parts temporarily transparent. I would prefer that it wasn't quite so transparent. There's also "translucent" mode under the Camera and Render options menu (the isometric cube menu on the upper right). That makes all parts translucent, which can be useful while trying to work on internal features. By default, there's no keyboard command for that, but you can assign one.

  • hansjuerg_jenzerhansjuerg_jenzer Member Posts: 4

    Hi Simon

    Thanks for your reply.

    I have now tried it with a custom FeatureScript (with Youtube, ChatGPT and Preplexity).

    I have a code that only gives an error on the last line.

    Everything else seems to be OK.

    The error message:

    mismatched input '<EOF>' expecting {'[', 'box', '::', 'boolean', 'number', 'string', 'array', 'map', 'builtin', 'function', 'undefined', '{', BOOLEAN, NUMBER, ID, STRING}

    34:2 Feature Studio 1

    Can you help me with this?

    Many thanks Hansjürg

    Code:
    FeatureScript 2559;

    import(path : "onshape/std/common.fs", version : "2559.0");
    annotation {"Feature Type Name" : "Apearance 50", "Feature Type Description" : "" }

    export const myFeature = setPartTransparency function(context is Context, id is Id, definition is map)

    precondition

    {
    annotation { "Name" : "Auswahl", "Filter" : EntityType.BODY, "MaxNumberOfPicks" : 5 }
    definition.selectedEntities is Query;
    }

    {
    setPartTransparency(context, definition.selectedEntities);
    }

    {
    setPartTransparency (context is Context, selectedEntities is Query)
    }

    {
    if (size(evaluateQuery(context, selectedEntities)) == 0)
    { throw regenError("Bitte wählen Sie mindestens ein Bauteil aus.");
    } setAppearance(context, {
    "entities" : selectedEntities,
    "appearance" : {
    "opacity" : 0.5
    }

    })

    }

  • S1monS1mon Member Posts: 3,100 PRO

    FeatureScript is designed to modify a part studio in a controlled way. You can tie keyboard commands to built-in features and commands, but as of yet, you can't do so for custom features. You can use option/alt-c to search for a command and then type some characters to get to a custom feature, but that's not as quick.

    What are you trying to accomplish by setting/unsetting the transparency?

  • eric_pestyeric_pesty Member Posts: 1,972 PRO

    You could use a configuration checkbox to configure the appearance of the part(s). Or use something like the "part color" FS to make it easier to configure than using the configured properties route…

Sign In or Register to comment.