6 Replies Latest reply on Apr 28, 2017 8:40 PM by Marco Wu

    Click on a part in design tree and print drawing using macros?

    Marco Wu

      I need to print stuff in order. I want to click on a part in design tree and print the drawing. For example, the one below.

      Would anyone please give me some directions?

        • Re: Click on a part in design tree and print drawing using macros?
          Josh Brady

          If you are not using PDM, SolidWorks has no way of knowing what drawing you want to print when you click on a component in an assembly.  There is no "link" from part to drawing, only from drawing back to part.  Therefore, you (the programmer) must know where all the files reside that might be linked to the part.  Oh, and what happens it 2 drawings are linked to that part?  You can create as many drawings as you want of one part.  You can create views of that part in a drawing of a completely different part.  You must know, as the programmer, how all your files are created and stored.  Then, you can write a program to look in those places for files.  You can then have SolidWorks check those files to see if they reference the part. 

           

          Or, if you are lazy and have good people who can follow standards, make a standard naming rule and look for the right filename. 

          • Re: Click on a part in design tree and print drawing using macros?
            Christian Chu

            As Josh mentioned, you can create many drawings from one part; however,  you can open only one (1) drawing from  a part (not from  open dialog box) if the file names of part and dwg are identical.  If there is any one missing character such as space, SW can't find the dwg from a part for you - Try it and you'' see !!!

            That's said, you can get the document name from part and use that name with extension .slddrw for your tasks such as print or open

            • Re: Click on a part in design tree and print drawing using macros?
              Francois Simon

              Hi Marco, this can be done with CUSTOMTOOLS (even if you use SW PDM or not). You are able to select one or multiple files from the SOLIDWORKS Design tree and print them directly without having to open the parts or its drawings. If you have multiple drawings then it is not an issue as all the referred drawings are automatically found, no matter how you have named them (part and drawings name can be different) or where you have stored them (Part and drawing folder can be different). In addition, printing is managed via profile so you are able to define print settings (Printer, paper size, orientation, scaling,...). There is a video available on YouTube in case you are interested.