Custom Sheet Metal Properties

Hello

I do it via the visualization cube. 

OBI WAN and ac cobra 427, all this works well for all bodies except the Sheet...

With the visualization cube, the dimensions of the folded and not unfolded part are obtained .

Good... the method I'm going to use in the meantime is to copy this expression in the "Description" field :

Sheet Thickness "SW-Thickness of tôlerie@@@SW-CutListItemName@SW-FileName(FileName)"... "SW-Flank Length tôle@@@SW-CutListItemName@SW-FileName(FileName)"x"SW-Flank Width tôle@@@SW-CutListItemName@SW-FileName(FileName)"

The ideal would be to be able to copy it in the field normally occupied by "Sheet" (see pj), but as max59 said, no way to copy a special character there ...


2019-02-27_14h33_20.png
1 Like

I maintain the idea of the Macro,

Personally I have a macro for the recording that does: 
- Dimetric view
- Zoom at your best
-Check in
=> all connected to an "S" key which means that by pressing S the model rotates, zooms in at best and saves.

=> It is possible to integrate the macro that injects the variables into a routine macro like this one, it will reinject the variables at each record but at least they will be there!

I use this system and having gotten into the habit of recording only via the macro, it's much more flexible, you can do what you want with it, it works for new and old parts.

I added in my macro a deletion of variables, an addition of new ones and it works great!

1 Like

I'm not very familiar with macros, but I do have the impression that I'll have to go through it.

Michael, I'll test your code when I have some time.

I will keep you posted.

 

Hello, maybe another lead.watch  at 23min 23 s

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

may the force be with you.

 

Michael DELACOTE, could we add to your macro the fact that it only applies the designation to bodies called Tole and not to profiles:

And if so, what is the piece of code to modify/add?
Thanks in advance!

Hello

Here is the modified code, the Cutlist article must start with "Tole" otherwise it won't work.

 

Option Explicit
    Dim swApp               As SldWorks.SldWorks
    Dim swModel             As SldWorks.ModelDoc2
    Dim swFeat              As SldWorks.Feature
    Dim swCustPropMgr       As SldWorks.CustomPropertyManager
    Dim NF                  As String
    Dim Liste               As String
    Dim Final               As String
    Dim st                  As String
    Dim swBodyFolder        As SldWorks.BodyFolder
    Dim swBody               As Body2
    Dim vBody                As Variant
    Dim i           As Integer
Sub main()

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swCustPropMgr = swModel.Extension.CustomPropertyManager("")
    
    
    NF = swModel.GetTitle() & ".SLDPRT"
    st = """"
      
    Set swFeat = swModel.FirstFeature
        Do While Not swFeat Is Nothing
            If swFeat.GetTypeName() = "CutListFolder" Then
            Liste = swFeat.Name
            Set swBodyFolder = swFeat.GetSpecificFeature2
            swBodyFolder.UpdateCutList
            Final = st & "SW-Longueur du flanc de tôle@@@" & Liste & "@" & NF & st & "x" & st & "SW-Largeur du flanc de tôle@@@" & Liste & "@" & NF & st

                    If Liste Like "Tole*" Then
                    Set swCustPropMgr = swFeat.CustomPropertyManager
                       swCustPropMgr.Add3 "Dimension", swCustomInfoText, Final, 1
                       End If

            End If
        Set swFeat = swFeat.GetNextFeature
        Loop
  
  
End Sub

 

3 Likes

Excellent! It works ;-)
Thank you Michael

2 Likes

And via a note like this 


dimension_piece__tolerie.sldnotestl
1 Like

Thank you Michael for your macro!

Hello

I'm new to the group. Here is the solution I use. 

by creating a custom property form for sheet metal. 

PL. "SW-Thickness of tôlerie@@@PLAQUE@Pièce1.SLDPRT" X "SW-Width of tôle@@@PLAQUE@Pièce1.SLDPRT" X "SW-Length of tôle@@@PLAQUE@Pièce1.SLDPRT"

I like the idea of the macro to  Michael DELACOTE

Have a nice day! 


propriete_piece_de_tolerie.pptx