×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

General configuration and assemby help

General configuration and assemby help

General configuration and assemby help

(OP)
OK, so I have an assembly with a bunch of different configurations in it.
-What is the easiest way to view the custom properties of a configuration?
-Is there a way to select all of the parts whose current configuration share a custom property?
Thanks,
-Jake Deschamps

RE: General configuration and assemby help

(OP)
I was thinking something more along the lines of getting the information from clicking on the model itself, so all of the data would be easier to visualize.

Basically the assembly is a large room of servers that are different configurations with custom properties.

So primarily, I want have it so that I can, ideally, right-click on a server and go to an option and have it tell me the custom properties.

The other thing I want is to do a search, say all servers whose Client is Company A, and have it be able to indicate on the model (highlight) which servers have that trait.

RE: General configuration and assemby help

deschamos,

   It sounds to me like you want to view the configuration data of sub-assemblies.

   Create an assembly or arrangement drawing.  

   Create a custom bill of material template that displays the parameters you want.

   Insert a bill of material into your drawing.

   Add item balloons.

   All of this stuff can be massively customized.

               JHG

RE: General configuration and assemby help

If I correctly understand you have the following request1:

1) Say you have assembly with several components (both parts and assemblies with multi configurations). And you need quick and easy solution to get all the configuration specific custom properties of the referenced configuration of the component

2) Say you have the same assembly and want to preselect all the components configuration specific custom properties of the referenced configuration is for example (Client = Company A).

Am I correct?

If so it can be implemented through the macro. Please confirm that my comments are correct and I can help you to write this macro.

Artem Taturevich
CSWP

RE: General configuration and assemby help

(OP)
Thank you, but since the time I wrote this thread, I discovered that this can be done with the Property Tab Manager (I think that's what it's called).

RE: General configuration and assemby help

And what about #2: searching through the components with specific custom properties? I think Property Tab Builder (is it the Property Tab Manager that are you refering to? It is on the Task Pane view) doesn't provide this functionality. Or I'm mistaken?

Artem Taturevich
CSWP

RE: General configuration and assemby help

(OP)
You are correct, it does not provide this feature.  I was thinking of using tags for this, but if you think writing a macro is a better option, then I ask for your help.

RE: General configuration and assemby help

Please take a look at the following macro. Specify the custom property field as "CustPropField" constant and it's value as "CustPropVal" constant as the search filter.

For example with the following filters:

Const CustPropField As String = "Client"
Const CustPropVal As String = "Company A"

All the sub-assembly and components on every level which have the configuration specific custom property for the corresponding referenced configuration in the assembly: Client = Company A, will be preselected and their names will be output to immediate window of the VBA Editor (Menu->View->Immediate Window (Ctrl+G))

Note. The suppressed/lightweigh components aren't considered.

- - - - - - - - - - - - - - - -
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swAssy As SldWorks.AssemblyDoc
Dim bRet As Boolean

Const CustPropField As String = "Client"
Const CustPropVal As String = "Company A"
    
Sub main()
    
    Dim swConf As SldWorks.Configuration
    Dim swRootComp As SldWorks.Component2
    
    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc
    
    swModel.ClearSelection2 True

    Set swConf = swModel.GetActiveConfiguration

    Set swRootComp = swConf.GetRootComponent

    TraverseComponent swRootComp

End Sub

Sub TraverseComponent(swComp As SldWorks.Component2)

    Dim vChildComp                  As Variant
    Dim swChildComp                 As SldWorks.Component2
    Dim swCompConfig                As SldWorks.Configuration
    Dim sPadStr                     As String
    Dim i                           As Long
    
    CheckCustProps swComp
    
    vChildComp = swComp.GetChildren

    For i = 0 To UBound(vChildComp)

        Set swChildComp = vChildComp(i)

        TraverseComponent swChildComp

    Next i

End Sub

Sub CheckCustProps(swComp As SldWorks.Component2)
    
    Dim swCompModel As SldWorks.ModelDoc2
    Dim swCustPrpMgr As SldWorks.CustomPropertyManager
    
    Set swCompModel = swComp.GetModelDoc2
    
    If swCompModel Is Nothing Then
        Exit Sub
    End If
    
    Set swCustPrpMgr = swCompModel.Extension.CustomPropertyManager(swComp.ReferencedConfiguration)
    
    Dim val As String
    Dim resVal As String
    swCustPrpMgr.Get3 CustPropField, False, val, resVal
    
    If resVal = CustPropVal Then
    
        Debug.Print swComp.Name2
        swComp.Select4 True, Nothing, False
        
    End If
    
End Sub
- - - - - - - - - - - - - - - -

If you need some more assistance I'm 'open' for help.

Artem Taturevich
CSWP

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources