• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

macro vba excel to change sw variables

  • Thread starter Thread starter clmmcl
  • Start date Start date

clmmcl

Guest
Good morning.
I am looking for the system to transfer variables from an excel spreadsheet to solidworks (2014).
I saw several examples but no one worked. I attach a part of sw (a cube... what imagination!) with three global variables (length width height), which I would like to transfer from excel. in the zip file there is the spreadsheet with the macro that however does not work (does not give error but still does not update anything)
Thank you.
 

Attachments

I did some evidence but without result.
then I saw that in the bees manual says that this method does not work if global variables were not created with the add3 method.
 
Thanks for the answer. the example file is very simple, but I would like to update a much more complex model, where I have not only variable changes but also configurations. then all the data I already have on excel so I thought it was easier to update the data from excel.
 
data tables manage both size and configurations.
configurations can be created through data tables.
you can upload data tables from existing excels, but as I have never done it I can not give indications about it. It is something to study and you have to have a model that reflects the final goal in order to be able to work properly.

What is your knowledge of solidworks?
 
I didn't know that configurations could be managed by data tables.
my knowledge of sw is quite basic, so maybe I'm focusing on the wrong solution!
I actually saw that the tables can be connected to an external text file. this text file can be easily created/modified by excel (vba) and then solidworks does the rest.
I try to change course!
thanks for the point.
 
do the tutorials on data tables and configurations to get an idea of how they work and how to manage them
 
Hello clmmcl,

This is what comes out to you when you create a table attached to global variables.
fsdfsdf.webpas you see there is the default configuration with the data in the columns you gave to the "cubo".
in the second configuration "a" there is instead the data that I put to the new "cubo".

you just need to create a first configuration in addition to the default one, give it any name and set new data in global variables being careful to select the validity of the equation "only for this configuration".

make this back in the configuration tree and create a "configuration publisher". This function automatically creates a data table as you see in the example.

Just throw in your excel table and you did.

I hope I was useful.
 
I have not had time to try, I will do it this evening; thanks to the example it is very simple to understand the operation.
I have only one doubt: made the table (or the various tables in case of more complex assembly) it is simple to change the values (i.e. changing the cells of the linked table) but the configuration should be changed manually or there is a way to tell the model to apply a certain configuration?
Thank you.
 
@CLICKinside the data table of the axis you can also add a column (which will be called $configuration@nameparte>) in which to define the configuration of the particular

@MitasI don't understand your procedure. below my doubts:
-I can't understand what global variables are for in a data table when global variables are used to connect values within the model.
-because the value of your table is preceded by =
- when you write to set use only for this configuration in an equation are you talking about working in the model environment and not in the data table?

Why do you do all this? how do you need to create a data table if the configurations you need to create them and then make them load by excel? is it no longer good to create all configurations at the data table?

this my procedure:
-created the model I coordinate the quotas and parameterized functions so that they are easily identifiable
-with the existing default configuration only launch the data table
- creation is asked what data to enter and, in the window that appears, select the values previously codified (on a particular complex with dozens of quotas and functions save life)
-(I do this because I find it more convenient in management) once I create the click table in the graphics area and close the table
- in the configuration panel select the table and open in a new window (this opens the table as if it were a excel sheet and not within the solid graphics area)
- I add all the variants I need and change the data
- I close excel and go back to solid that warns me that the configurations I add will be created

maybe the goal and result made with your method is different and can come back useful in the future
 
@massivonweizen the use of global variables was for @cl. I think he had already built the whole model with this technique. when I write "only for this configuration" I refer to the menu with which you can choose if the quota is applied for all configurations or only for the one currently in use.
View attachment 52756
@cl.to connect the global variables of a component or subaxieme to a superior one you can also call them as connections, of the type:

"name_var" = "name_var@nome_assieme.assembly"

from the sub component to the assieme father.
 
Good morning.
I'm a gabi drum.
once you create the whole list of configurations ..I would like to save all configurations as part file.
not multibody together. .
I don't know if I explained myself in case I attach an example
 
Good morning.
I'm a gabi drum.
once you create the whole list of configurations ..I would like to save all configurations as part file.
not multibody together. .
I don't know if I explained myself in case I attach an example
if I understood you would like a tool that in solidworks is not there, that takes a part with so many configurations, for each of these would make you a new file, renamed it with the addition of the configuration name I imagine, and erase for each of these all configurations
 
I hope there's someone who asks you the same thing.. as soon as I know the answer I write to you.. and let's see if I'm gonna stick around.! I will manage.. the point is that once the excel is created, is everything? Good. I want all these configurations to be distinct bodies and not a son! I have explained several times but nothing.. I have misunderstandings or bho. .
 
in your other discussion I linked you twice the page of a similar discussion of the solidworks forum.
the first time directly (post #15), the second indirectly (post #21) citing a discussion of this forum where another user has done the same, it seems to me, your request and that is to extrapolate all configurations of a part as single-part files. in that discussion the user responded that he had solved with the macros present in non - solwork (and with this we are three times that link the potential solution to you).

Unfortunately, and I've already pointed it out, you have no ability to explain. and not because you cannot explain the concept, but because you are not able to write.
You can take it as an offense, which is not in my intention, or as a criticism and try to improve yourself.
 
Excuse me for lim comprehension thank you.. Sorry I'm new and I'm a little high sea with work and I wanted to reduce time
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top