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.

Image (New Custom Feature!)

MichaelPascoeMichaelPascoe Member Posts: 1,979 PRO
edited March 2023 in FeatureScript

Image (New Custom Feature!)

https://cad.onshape.com/documents/f7a45d78c374497d37c1d2cb/w/04c6c220e40120d79db4c05e/e/161ce64bb947e34f19588b33?renderMode=0&uiState=63ffb066af4a881b3447d2c9

Image allows you to:

  • Quickly place images in the part studio without having to sketch
  • Reference geometry for the image size
  • Change the transparency of the image

Special thanks to @billy2 at rustyshed.com for collabing this with me. He is responsible for:
  • Rotate
  • X & Y Center %
  • Aspect ratio
  • Image height & width


If you use Onshape for work, consider saving hours of work by automating your process with custom features and API.
CADSharp specializes in custom features and API.




Image - Tutorial


https://www.youtube.com/watch?v=r7ZsW2ZYoaY


Learn more about the Gospel of Christ  ( Here )

CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴

Comments

  • S1monS1mon Member Posts: 2,957 PRO
    This is very cool. Lots of nice features here.

    The one big issue is that lots of times the most challenging part is scaling the image correctly based on some known distance on the image which is not directly related to the overall length/width of the image. That alone will probably keep me using the existing workflow inside the sketcher. I'd love to see some of this functionality built into the 1st party native tools.

    I would add things like mirror (left/right and top/bottom) as well. Some simple background removal shouldn't be that hard to add to a first party tool. With the state of AI image processing there must be open source versions of such functions.

    One way I look at it is that as an Onshape user, I don't want to have to open an image editing program to get something that's clean and easy to use in this type of context.
  • david_mcmahondavid_mcmahon Member Posts: 35 ✭✭✭
    @MichaelPascoe

    This is absolutely fantastic! Thanks for sharing. As an FYI, I just logged a support ticket regarding images inserted into a sketch. Apparently, OnShape has issues (I was getting a solid black image) if the image has a width greater than 4096 pixels (ish).

    @S1mon

    My biggest issue is that OnShape will not just insert the image at its original scale. For instance, I traced a large object on paper and then scanned it on a wide format scanner. When I insert the scanned image into OnShape, it requires me to sketch a box which messes up the original scale. I then have to resize it which introduces errors. When I insert the same image in Coreldraw or Illustrator it doesn't mess the scale up.


  • S1monS1mon Member Posts: 2,957 PRO
    @david_mcmahon

    Image formats (JPG, PNG, GIF) don't necessarily say how big they are in real world units. Some formats do. Many image files may just have pixel dimensions, and then it's entirely dependent on pixels per mm or pixels per inch or whatever. Even if the image has both a pixel size and a number of pixels per real world unit, I haven't seen a CAD program where it takes that into account for the default scale. It could be helpful, as you point out in some cases.

    In Onshape, after you insert the image, and before you've constrained and dimensioned everything (sketch is still all blue), you can add a line on top of a known distance on the image, add a dimension to that line and then set it to the correct size. That will scale the whole sketch correctly. Then you can constrain things however you need/want.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,068 PRO
    edited March 2023


    It was great collaborating with Michael on this feature script. Michael is really good at creating feature scripts and CAD Sharp is a great place to have custom scripts created.


  • S1monS1mon Member Posts: 2,957 PRO
    Wow. This makes this better in many ways than what's built in.
  • Cary_BettenhausenCary_Bettenhausen Member Posts: 44 PRO
    Terrific! Thanks for this, I'll be using this frequently.
  • andy_rubayeandy_rubaye Member Posts: 2
    Hi all, I am a casual hobbyist, I do not have any professional license and I am very much a beginner with Onshape. I am currently struggling to no end trying to figure out how to do this. I have a photo of a part, I am just trying to make it so that a certain distance within the image matches a line that has the correct dimension. Is this possible for us free plan simpletons or do I need some special license to use these "Custom Features"? (Sorry if this is a double-post, not sure what is happening here).
  • dirk_van_der_vaartdirk_van_der_vaart Member Posts: 548 ✭✭✭
  • MichaelPascoeMichaelPascoe Member Posts: 1,979 PRO
    edited January 16

    @andy_rubaye You can use the free plan for custom features. Make sure you are signed in when you view the custom feature document. There will be a   +   button at the top of the screen, click that then select the custom feature and it will be added to your tool bar.




    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   Learn How to FeatureScript Here 🔴
  • steven_van_luchene848steven_van_luchene848 Member Posts: 122 PRO
    thanks! great feature. the "reference" option is missing for some reason from the built in feature and absolutely necessary.  

Sign In or Register to comment.