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

macro solidworks esistenza parameter

  • Thread starter Thread starter Orlandi Stefano
  • Start date Start date

Orlandi Stefano

Guest
My name is stefano orlandi and I am an old solidworks user
I used solidworks before version 2000
in my career I used part files in configuration
which contained different parts where the parameters (dimensions) had different dimensions
for different configurations.
these files were comfortable because either with the table or with the command configures quota you can
have a list of size and thus facilitate search.
with the introduction of pdm solidworks the use of parts in configuration is not recommended
because it is difficult to manage.
so I was forced to split the file in configuration into many side files with single configuration.
Unfortunately when there are many files and you want to know if a part of certain size already exists you need to open
all files and check if there is already what you are looking for.
or if in the pdm there are dimensional fields you can do a search for those dimensional fields
always that those who compiled them had the pleasure of coherence between part and part size
registered.
tired of these searches I built a macro that reads all the part files contained in a folder
and read the size values and save them in an exel sheet.
the search in the exel sheet is then very fast.
My problem is that if the model does not exist the size sought the program gives error.
I wondered if a variable date exists in the part model.
which commands I must insert into the macro.

thank you in advance to those who can help me.
 
I don't understand anything, but I don't know anything about macro.
if you attach the macro and maybe an example file who knows something will give us a look and advise you
 
Last edited:
I think just enter the error control... according to the variable type you set the control type.
It's hard to help without seeing the code though.
 
17/05/2021
here is part of the macro code that interests:

swapp = createobject("sldworks.application")
part = swapp.activedoc
swdim = part.parameter("d1@schizzo1")
lbld1.text = 1000 * swdim.systemvalue

se nella parte non esiste la variabile d1@schizzo1 the error program.

Thank you.
steak
 
17/05/2021
here is part of the macro code that interests:

swapp = createobject("sldworks.application")
part = swapp.activedoc
swdim = part.parameter("d1@schizzo1")
lbld1.text = 1000 * swdim.systemvalue

se nella parte non esiste la variabile d1@schizzo1 the error program.

Thank you.
steak
as mentioned more in this forum, you have to write the type of software that you use, so that those who make available their time can be vanized. . .
I think you're not using the solidworks vba but a vb.net executable or something.. .
below I write the passage to vba, see if it also works in the program you are using, alternatively convert into the language you use:

if swdim is nothing then
msgbox ("nonexistent rate!")

debug.print swdim.systemvalue
end if
 

Forum statistics

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

Members online

No members online now.
Back
Top