Automate configuration selection

Hello

I'm currently setting up a module. I know that the configuration generates the parts, but to make it easier for the user to use, I would like him not to have to select the configuration and that it be recognized when the user enters a dimension.

For example, if L>30mm then the module automatically switches  to "Large" configuration. I would like to avoid a macro, for maintenance reasons (parameters can be modified by the following). I have searched a lot but I don't see how to proceed at all, I only find the opposite way to go...

Thank you in advance for your suggestions.


conf.sldprt

Via the smart properties utility

http://www.axemble.com/sites/default/files/reprise/KB-Article-001539/Presentation%2520des%2520utilitaires%25202008.pdf

It is possible to select the parts via the dimensions

I think it should also be possible to do it via an Access table

since access is configured and controllable via excel and excel can control SW

So there must be possibilities to make all these little people react

@+ ;-))

Hello, it is not possible directly by equations but we can imagine inserting the same part several times as indicated in the last message of this link:

https://forum.solidworks.com/thread/57285

Otherwise a macro would do the trick, why be reluctant?

Hello

You can manage this by equations in your room.

You can also manage it via a family of parts by entering the equations in Excel, which can be more meaningful for an average user. But you will have to create the new configurations via the Excel sheet of the family of parts, not by creating the configuration live.

@gt, you're writing from a "head" tablet, I can't seem to read you again!! "Since Acérés is a parapet that is grated and controllable via Excel ... "   :/

2 Likes

@ Benoit

I'm back on PC

I correct the gross errors yes the apple plays tricks on me

not nice

@;-(

1 Like

HS: The worm is in the fruit hehehe!! :)

2 Likes

Thank you very much for your answers. I'm looking at all of that!

If I try to avoid the macro it's because users are not trained in VBA and wouldn't be able to modify the code if they had to make changes in the module. And since I'm only passing through, the module would then be unusable. 

Clearly the equivalent in macro would be this:

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
Dim myModelView As Object
Dim L As Single
L = InputBox("L_inter_épau", "Upset")

    If L > 170 Then
        boolstatus = Part.Extension.SelectByID2("Large [>175mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
        boolstatus = Part.ShowConfiguration2("Large [>175mm]")
    ElseIf L > 145 Then
        boolstatus = Part.Extension.SelectByID2("Medium [145-170mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
        boolstatus = Part.ShowConfiguration2("Medium [145-170mm]")
    Else
        boolstatus = Part.Extension.SelectByID2("Small [55-145mm]@EX10610_00000_10_boni. SLDASM", "CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
        boolstatus = Part.ShowConfiguration2("Small [55-145mm]")
    End If
    
End Sub

 

Hello

I immediately think of DriveWorks, start by looking at the xpress version provided with SolidWorks.

@+

1 Like

Excel is your friend:

It is quite possible to control a part via excel but it is also true in an assembly.

So you can change the name of the configuration of a part according to the value of a dimension for example.

It will work well and is quite easy to understand by someone who has already used the equations in excel (pretty much everyone in BE).

The only 'heavy' constraint is if you copy the assembly, rename parts or dimensions... The parameters read by Excel will no longer be good and this will therefore generate errors or random results. (but it's the same problem in your macro and write a macro that adapts to the names of the parts and configs...)

If you only manage a single assembly with parts that never change, this is probably the solution for you.