1 Reply Latest reply on Oct 22, 2014 3:22 AM by Daniel Andersson

    macro open drawing

    Luigi Piron

      Good Morning

      i'm looking to open the drawing from assembly by API way, it seem the only way to do that is to check the TCP of the assemblyDoc and to increase of 1 the Number part of the TCP

      ex Assembly.GetTitle


      I' have to take the name manipolate in order to openDoc


      There is anybody who knows another way to open drawing from assemblyDoc

      or have already write a code that manipolate the name of the TCP_____  to do that ?

      thankyou in advance


      Piron Luigi

        • Re: macro open drawing
          Daniel Andersson

          The easiest way is if you have rules that always can tell what the filename of the drawing would be. Then your idea is quite easy to implement. Note that drawings and assemblies can have same filename since they have different file extensions. So you do not have to do TCP....+1 for the drawing.


          The downside with this is that as soon something deviates from the rules or if the assembly is referenced to multiple drawings. Then the drawing(s) won't be found.


          To cover all scenarios, you have to go through all drawings and check if the assembly is referenced. Quite time consuming... the function would be similar as the one you can use in Solidworks Explorer. But triggered with API.