4 Replies Latest reply on Nov 20, 2017 10:28 AM by Alex Burnett

    how to create macro for change in template

    Krishna K.

      hi sir...

      we have changed our drawing template to new one, now i have to modify around 8K drawing to new template...and it will take so much time..also in our drawings there are many note block like weld note or painting or plating note etc which also modified to new one...and there note are different depends upon the part/ weldment etc. Can you help me to create a macro for updating the drawing to new format and text block...

       

      thanks...

      Krishna

        • Re: how to create macro for change in template
          Deepak Gupta

          Krishna, as suggested in the private message did you tried #TASK for updating your sheet formats.

           

          also in our drawings there are many note block like weld note or painting or plating note etc which also modified to new one...and there note are different depends upon the part/ weldment etc.

          For this you get the referenced model from the drawing view and then get the feature type to get the type of part (here is an example: Does Part Contain a Weldment Feature Example (VBA) ). And then update/change notes as needed..

            • Re: how to create macro for change in template
              Krishna K.

              Thanks Deepak.....

               

              I created one macro and it is almost working for batch conversion for template. But our main problem as i mentioned, each of the drawing contains many text block depends on different types of part/ weldment/ installation drawing. For example if the part is a sheet metal component then we need to add a text block to mention the total laser cut length into the drawing or if the part is a purchased item then we have to add "XXX" mark on the drawing or if the part is used for hydraulic fittings then there is another block, like that there are more than 100 different blocks in our library.  Normally while creating drawing we will insert these block (.sldblk file) to the drawing as per component.

              Now when i change my template to new one, all the inserted blocks are missing from the drawing. So we need to call these blocks again to drawing. This is taking lot of time for each drawing.

              I am working to create a macro with following requirement

              -Assign manually new block file name to old block file name(Some of the blocks are modified to new block. This should be a single time job and after assigning new block name against old block name, whenever old block with that particular file name found in drawing it has to replace with new one after running macro)

              -While opening each drawing, macro has to identify each block name and has to be stored in a temp location.

              - Old template has to replace to new template for each drawing.

              -The block stored in the temp file has to add to updated template drawing with equivalent new block file.

              Can you help us to create one with above requirement? TIA