6 Replies Latest reply on Jan 12, 2019 3:05 PM by Sam Sam

    Set density through data card variable?

    Craig Schultz

      Is there a way to change the density of a part in SW using a data card variable?  We have a long list of glass that we use, and it would be nice to assign this value when creating/modifying a new lens.

       

      The lens material is selected through a drop down on the data card.  I have it set up to grab the alternative material through a "Text with Alias".  I would like to do the same with assigning the density.

       

      Thanks,

      Craig

        • Re: Set density through data card variable?
          Sam Sam

          Hi,

          In advance I apologize, perhaps I did not understand something therefore I want to specify:

           

          - what is used base of the materials *.sldmat?

          - with the help of the Card only alternative material changes, the value in a tree of the file remains without changes, only properties change?

           

          Craig Schultz writes:

          ....  I would like to do the same with assigning the density...

          and right there question:

          ...  Is there a way to change the density of a part in SW using a data card variable

           

          It is possible to specify once again where should will change value - in a tree or in properties?

          It seems that in a tree - but then it not too most that with material?

           

          Change in a tree = this change in base of materials?

           

          In that case, I have a library with virtual files of matermal, these files have all necessary properties.

          By means of SQL requests I select the necessary data from this library of matermal - but I cannot change them in *.sldmat base.

           

          I where that had an example how to make SQL request to *.sldmat base if this is intresting I can look.

          But I think that change of density = material change.

          And as far as I understood material in a tree of the file does not change from the card?

            • Re: Set density through data card variable?
              Craig Schultz

              I just want the ability to overwrite the density with a variable/custom property.  That's it, simple.

               

              I don't want to be required to go into every part and change the material or create a custom material for every glass type.. I don't want to so SQL requests.  I don't want to create a library.  I don't want to create virtual files. Why not have it pulled from a list?  Simple = better.  Controlled in one place = better.

               

              You can either specify in the material, or the variable.  If there's a change, it gets updated in both spots because obviously you wanted a change.  You could select from the material database, or just change a custom property.

               

              It's asinine that you can't overwrite using properties.

                • Re: Set density through data card variable?
                  Sam Sam

                  Hi,

                  Thanks for the answer, task it is generally clear and I have a similar solution - and I use it.

                  But that it was more simply and quicker to make - interest the following questions:

                  - what file format with data and what columns? (if it is possible at least the screenshot)

                  - what version of Office is used?

                  - except Material and Density on the Card of the file still there are some properties connected with material (for example: sortament, profil, thickness, dimensions, type...)?

                  - in properties of all files there is Density (or it needs to be added)?

                  - what version the SQL server is used?

                  - Bases of the materials SolidWorks are used too (except glass)?

                  - Configurations of the file can be used and can have different material?

                   

                  And still there is a question - Density as the user property can be used in the Equations.

                  The equations can be in the file or in the PDM Card.

                  If we change density in the Card probably there have to be two fields - Density and Alternative Density or it not so?

                   

                  If there is no time for answers - I will prepare an example and the short description on the basis of my solution (just there is no Density - but the principle similar).

              • Re: Set density through data card variable?
                Sam Sam

                There is one more question:

                Configurations are used?

                Files can have different material in configurations.

                If configurations are used - where there will be saved alternative material? In files or not?

                • Re: Set density through data card variable?
                  Sam Sam

                  Hi,

                   

                  I apologize, there is not enough time as I promised - the short description (on memory - something can forgot):

                   

                  1. To create a shared folder on the Server (for example D:\Data) and to place in it files / files with data.

                   

                  2. In SQL Server Management Studio / Server Objects / Linked Servers - to check existence of Microsoft Office of XX. 0 Access Database Engine OLE DB Provider (usually it has to be, but if it is absent - it is necessary to establish in addition).

                   

                  3. On the Linked Servers point - "Create New Linked Server..."

                   

                  4. To choose:

                  - Provider - Microsoft Office of XX. 0 Access Database Engine OLE DB Provider.

                  - product Name - (Excel / Access / ...)

                  - Source - D:\Data\ ***.xls or ***.mdb (the file with data)

                  - The line of the Provider is Access 15.0 / Excel 15.0

                   

                  5. In the Tree on new Linced Server - to Check connection. If it is possible to check Tables - everything means normally.

                   

                  6. I do not remember whether it is necessary to add users / users on the Safety tab (or they are added automatically).

                   

                  7. It is possible to close SQL Server

                   

                  8. In PDM Administration/VaultName/Lists (for cards) - to create New List

                   

                  9. To choose - From SQL Database

                   

                  Examples of inquiries:

                   

                  - for Excel:

                   

                  SELECT [Density]

                    FROM [LIST]...[Density$]

                   

                  - for Access:

                   

                  SELECT    Density

                  FROM        [Glass]

                  ORDER BY Density

                   

                  There is still Add-ins - unfortunately do not remember the reference from where it.

                   

                  There are also other options and examples, but time for this purpose is necessary - I will add later.