5 Replies Latest reply on May 16, 2018 2:18 PM by Etienne Canuel

    Faces of weldment profil

    Etienne Canuel

      Hello,

      I would like to create a Macro to list all cutting on a structural member.

      I tried lot of solution but the most problem is with repetition. All reference to features that modify the first member is lost.

      I would like to find all faces that was created by the base feature "Weldment feature".

      Therfore i have two solutions. Whether find the axe of the member, which can i define all faces parallel or perpendicular to the axe.

      Or find how Solidworks locate this data with persistent ID. I noticed that the length of persistent ID is correlated with the type of member face.

      ex : Each end of the member as the same length, each external face to.

      I imagine that Solidworks store data about to calculate the length of the member that can i collect in cut list.

      If someone as idee that help me.

      Thanks

          • Re: Faces of weldment profil
            Etienne Canuel

            I already know this macro. I developed a macro as addin in c# that list all weldment member of assembly and create for each a step file and 3d pdf. I also provide a list with type of welmdment profil, length and quantity. But to help my laser cutting provider and obtain an estimate faster, I would like to give for each weldment member a number of hole, the cutting length for each hole and the cutting length of extremities.

            Now, I can it with weldment member which is not repeated. In this cas, I can separate faces created with base feature and feature wich create machining. But when I repetat a weldment body, all faces are created by the repetition feature.

            To calcutate all his information, I only need the profile axis. I imagine that Solidworks store this information because he is capable to calcultate the weldment member length and update the cut list also for repeated body.

            Now I can suppose the axis with the information given by Body2.GetMassProperties(nDensity) and Body2.GetExtremePoint(x, y, z, out outx, out outy, out outz) but in some cases it does not work. When the profil length is shorter than its section.

          • Re: Faces of weldment profil
            Etienne Canuel

            Après de longues recherches, j'ai trouvé un moyen de récupérer les faces d'un profil sans les usinages.

            La méthode n'est pas très conventionnelle, elle se base sur la valeur renvoyée par ModelDocExtension.GetPersistReference3().

            En convertissant ce tableau de Bytes[] en String, on peut y trouver certaine partie sous forme de texte comme "moSideFace3IntSurfIdRep_c", "moFromSktEntSurfIdRep_c", ou "moEndFaceSurfIdRep_c" qui représente la façon dont la face a été crée.

            Si la face est issue d'un profil, elle contient en premier la chaine "moSideFace3IntSurfIdRep_c". A partir de ça j'ai pu terminer ma macro.

            Si cela peut vous aider.