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

visual basic for application & vba

  • Thread starter Thread starter folle76
  • Start date Start date

folle76

Guest
The idea is always that. maximum integration between cad and management data in small businesses. we have a management that works with sql server and therefore great ease of creating customized views with sql and reporting with crystal reports. we have proes and no desire or money to buy a pdm system, place that can really interface with our management that is distributed by mondoesa.
with the vba and the bees of proe at least I could (after having exceeded the insufficient documentation) load in the management database the parameters of proe models and, possibly in need, can do the opposite. Here, for those who care and know vba, a small example to print in the immediate window the parameters values of an active model in session. If someone can make me have some more complex and interesting examples I would be grateful. I would like to exchange the knowledge, where I will deepen the subject.
proe as modeler is exceptional, protoolkit (incasinatissimo and with horrible documentation) and vb bees for proe are less. There is very little attention to this and little people who understand about it.

private sub command0_click()

dim model as ipfcmodel
dim session as ipfcbasesession
dim connection as ipfcasyncconnection
dim params as ipfcparameters
dim paramvalue as ipfcparamvalue
dim param2 as ipfcbaseparameter
dim c as ipfcparameter

on error goto fine:

dim classasyncconnection as new ccpfcasyncconnection
set connection = classasyncconnection.connect(dbnull, dbnull, dbnull, dbnull)
set session = connection.session
set model = session.currentmodel

set c = model
set params = c.listparams()
for i = 0 to params.count - 1
set param2 = params(s)
set paramvalue = param2.value
debug.print paramvalue.stringvalue
next

end:
if not connection is nothing and connection.isrunning then
connection.disconnect (1)
end if

end
 
Thanks crazy, you're doing a good job.

we are a design studio and even if we do not have production, sometimes it happens to have to provide customers with a complete and well-organized data system.

It's a topic we're trying to get into at this time.
If I have something interesting ... and especially a little time to do it, I will gladly change the courtesy.
 
I store in an access file all the information necessary to manage my projects by taking the data contained in the proe parameters through the separate bom saved in txt format and imported in access with a vba program, with which I manage the distinct and can view the drawings in pdf.

if you woven, I can prepare an example file.

greetings
 
prerequisite for you to turn the example is:

1) adapt the vba code that exports the parameters of the model to session in a local access table;
2) register the .dll and set the environment variable as attached.
 

Attachments

I store in an access file all the information necessary to manage my projects by taking the data contained in the proe parameters through the separate bom saved in txt format and imported in access with a vba program, with which I manage the distinct and can view the drawings in pdf.

if you woven, I can prepare an example file.

greetings
I basically already know how to extract structured data from a .txt file, but clearly it can also interest others. more than anything, it will be more trivial but I don't know, I don't know how to save the bom in a .txt file.

that file I posted I basically use it to avoid coding twice.
as I have access to the sql tables server of our management system I make a queries of settlement or update on the base table of the analog articles of sql populated or updating it with the parameters of the .prt proe.
probably in the near future I will go, starting from a .asm collection, to popular not only the table of the analogue articles, but also that of the distinct base, so that I do not have to do twice the distinct (in proe and in the management system).

As for the reverse problem (write from management to proe) I must understand well whether it can be productive or not for the company in which I work.
other potential of bees that are not access to data I have not explored them. However, if there is someone who has a problem I can look well at the properties and methods of specific bees objects.
 
to save the distinct bom in a .txt just do:

information > separate base > ok
file > save by name

generally proe assigns the .bom.1 extension to the file, just rename it in .txt

as soon as possible I will transmit an example access file
 
I attach the example access file, with a small .txt distinct and the exchange file for the .bom distinct

you need to save everything in a folder c:\try

in the mask of the distinct with the black arrows dx or sx you can descend or climb in the various levels of the project

available for any clarification.
 

Attachments

Hi.
is the first time I write about this forum.. .
in the warehouse where I work, in order to manage all the files of proe we bought pdmlink. But first I was working on a project to manage files via acess.. .
I created a database to succeed, in a few seconds, to understand where a piece was used in the different axioms loaded in the database.
already that I was there but I also developed an applcative that extrapolates the distinct designs and design of a whole machine.. .
to upload the base date I used a macro that generated me and then exported to a precise folder a *.csv file.
the cvs file was nothing but the export of a table created at the general level.
If you're interested. . .
 
Hi.
is the first time I write about this forum.. .
in the warehouse where I work, in order to manage all the files of proe we bought pdmlink. But first I was working on a project to manage files via acess.. .
I created a database to succeed, in a few seconds, to understand where a piece was used in the different axioms loaded in the database.
already that I was there but I also developed an applcative that extrapolates the distinct designs and design of a whole machine.. .
to upload the base date I used a macro that generated me and then exported to a precise folder a *.csv file.
the cvs file was nothing but the export of a table created at the general level.
If you're interested. . .
I care a lot, I am in the condition of having to create and extrapolate a distinct base in .xls / .mdb / .csv and I do not know exactly where to start............so please enlighten me about it.

Thank you.
 
to give an eye to the example that I have attached to you in your time?
is used to import a distinct bom into access
 
to give an eye to the example that I have attached to you in your time?
is used to import a distinct bom into access
I tried to save the distinct base that I find in info but I do not see any product files, I inform you that I am trying on version 5.

Where am I wrong?
 
I attach the example access file, with a small .txt distinct and the exchange file for the .bom distinct

you need to save everything in a folder c:\try

in the mask of the distinct with the black arrows dx or sx you can descend or climb in the various levels of the project

available for any clarification.
I also tried to save the folder in the directory as indicated above, but it seems that it does not work.

Can you clarify?

Hello and thank you
 
I tried to save the distinct base that I find in info but I do not see any product files, I inform you that I am trying on version 5.

Where am I wrong?
Sorry, dani-3d,
I managed to open the distinct base in txt.

and for importing into access from the program you did as I do?

Thank you.
 
Bye.

the program in visual basic that import data into access is set to read my txt with a certain record track. If you know this programming language I tell you where to go to work to read your txt, otherwise post it to me that I see what I can do.

greetings
 
Bye.

the program in visual basic that import data into access is set to read my txt with a certain record track. If you know this programming language I tell you where to go to work to read your txt, otherwise post it to me that I see what I can do.

greetings
Hello, dani-3d,
I list you here to follow the fields that I would like to extract automatically:

code
Description
quantity
n°_revision
material
treatment
area
weight
thickness
size_x (max size)
measure_y (max size)
measure_z (max size)

Of course I need it for father/son relationship

together_general



Understood
subsidy
Parts
...
. .
. .
. .
I hope I've been clear.

Hello and thank you.
Blueberry
 
Hi.

before bringing the data to access I recommend you to do the following steps:

1) define the parameters that you need by modifying the separate table that I have posted to you in recent days, which is quite simple and contain the information that is needed both for the separate and for the mask of the table.

2) modify the defined file in the bom_format to export the separate bom.

3) import the file into access

once set point 1 the rest is simple

among the paraneters I recommend you to insert one that you can call it type that indicates the type of detail or the set that is useful both for us and for those who must read the distinct and indicates for e.g. if the code is a welded assembly, worked, sheet metal grating etc.

I attach a .txt file with the relationships and types I use, with these instructions I also create a parameter called spess that contains the size of the starting crude.

greetings
 

Attachments

Hi.

before bringing the data to access I recommend you to do the following steps:

1) define the parameters that you need by modifying the separate table that I have posted to you in recent days, which is quite simple and contain the information that is needed both for the separate and for the mask of the table.

2) modify the defined file in the bom_format to export the separate bom.

3) import the file into access

once set point 1 the rest is simple

among the paraneters I recommend you to insert one that you can call it type that indicates the type of detail or the set that is useful both for us and for those who must read the distinct and indicates for e.g. if the code is a welded assembly, worked, sheet metal grating etc.

I attach a .txt file with the relationships and types I use, with these instructions I also create a parameter called spess that contains the size of the starting crude.

greetings
Hi.
some clarifications:
1) When you say you change the separate table, inserting well the parameters I need, do you refer to the file in access? ?

2) where do I find the bom_format file to edit?


the parameter, like, had escaped.

the reports you posted to me are interesting....
if you clarify the meaning of the fields you use in access I have the impression
who are the same as me.

I'm probably asking you some trivial questions, but I've just been trying to figure something out with pro-e.

I've already created the mask to put in the table, you want me to put it to you to take a look?

Hi.
 
no, for the moment forgets access, one step to the fly.

creates a drw of a set and enter the separate table.tbl

table>list from file

surely you will appear a distinct with empty lines, at this point
mouse button in the cell immediately below the column header > properties, and change the instruction that appears to you.
for example if you click below the description you will have &asm.mbr.describing where I describe it is the name of my parameter, you give it to replace it with what you use.

e.g. &asm.mbr.pippo

do this for each column of the separate until you have all the information and eventually save the table.

for relations.txt copies the paragraph that you are interested in the relationship of the part and insert the main quotas instead of 0 in the parameters relative to the size

[Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep]
side 1=0
Iung = 0
sp=0
 

Forum statistics

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

Members online

No members online now.
Back
Top