Equations and Data Sheet

Hello

I get in Equation at the level of global variables the value read in TXD1@Schéma2. I call this variable Data1

I use this value in my calculation and retrieve calculation1 and calculation2

depending on the value of Data1, I would like to make Calcul1 or Calcul2 appear in the parameters of my DataSheet. Is this possible? With what syntax? without going through the family of parts

Thank you for your feedback

Kind regards

 

LSE

Hello @LSE_BR ,

What do you mean by "DataSheet settings"!?  

Hello

Sorry, I thought my answer had been validated. I must not have clicked well....

we get the table by doing File - property.

I take this opportunity for a 2nd question: how to permanently delete a row from this table for all configurations? 

thank you in advance for your help

Have a nice day

LSE


2022-01-11_10h35_37.png

Hello 

One way would be to use the IIf() function in "equation" and then assign the result in "custom property" 

1 Like

For the deletion of properties it is to select the line then delete, I think that has no choice it is to be done for each configuration,

(it would be better to ignore this property, wouldn't it?)

A new discussion will surely bring you more help, 

And to delete a property in all configurations, you have to go through a macro.

See example below to transfer the "Revision" property:

' ----------------------------------------------

' Postconditions: The custom property Input1 is added to the file.

' NOTE: Because configurations are not supported in drawings, pass a blank string when the file is a drawing.

'------------------------------------------------

Dim swApp       As SldWorks.SldWorks

Dim swModel     As SldWorks.ModelDoc2

Dim retval      As String

Dim vConfigNameArr              as Variant   

Dim vConfigName                 as Variant   

Dim swActiveConf                As SldWorks.Configuration   

Dim swConf                      As SldWorks.Configuration   

Dim swConfMgr                   As SldWorks.ConfigurationManager   

Dim swDerivConf                 As SldWorks.Configuration   
    
Dim swConfig                    As SldWorks.Configuration   
    
Dim bRet                        As Boolean   

 

Sub main()
Set swApp = Application.SldWorks

Set swModel = swApp.ActiveDoc

    Set swConfMgr = swModel.ConfigurationManager

     Set swConfig = swConfMgr.ActiveConfiguration

    

    vConfigNameArr = swModel.GetConfigurationNames


retval = swModel.AddCustomInfo3("", "Revision", swCustomInfoText, "-")

    vConfigNameArr = swModel.GetConfigurationNames

 For Each vConfigName In vConfigNameArr

        Set swConf = swModel.GetConfigurationByName(vConfigName)

        

        ' Do not assert; will be NULL if (derived) configuration already exists

retval = swModel.DeleteCustomInfo2(swConf.Name, "Revision")
     

    Next


MsgBox retval


End Sub

' ----------------------------------------------

 

1 Like

That's really great! it works great!

A big thank you to you for your help.

Have a nice day

LSE