cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

New to VB and Pro/E

ptc-2032585
1-Newbie

New to VB and Pro/E

Hi everyone

Though my experience with VBA for Excel has allowed me to do what I've needed so far, VB for Pro/E needs a push.

I'm starting simple: a dialog with 3 text fields to change Length, Width and Height (comprimento, largura, altura in Portuguese) of a prismatic part.

On the dialog side, I've managed to get 3 variables converted to Double from the text boxes.

Now I need to get those values to the corresponding parameters in the Pro/E model.

I (think I) need to "get the session" then "get the current model" in order to "get the respective parameters" and change them.

Can anyone help with the "getting the session" and "getting the current model" parts to get me back on track?

I am using Visual Studio 2008 Express if that makes a difference.

The VB text I used is in the attached text file.

Thanks in advance.

Rui


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3

Ok update to this.

Got a handy reference to the manual from Jon Sprang(thanks) but now I'm
stuck (again).

Situation: I've managed to read parameters and their values from the
model to the application.

Now I need to send a value back to a parameter.  Any tips on how to do that?

I have the model identified, I have the session connected, I have the
parameter and I have the variable.  How do I get the variable's value to
the model's parameter?

Thanks for any clues, the more detailed the better.

Thanks

Rui



Rui Vaz wrote:
>
> Hi everyone
>
> Though my experience with VBA for Excel has allowed me to do what I've
> needed so far, VB for Pro/E needs a push.
>
> I'm starting simple: a dialog with 3 text fields to change Length,
> Width and Height (comprimento, largura, altura in Portuguese) of a
> prismatic part.
>
> On the dialog side, I've managed to get 3 variables converted to
> Double from the text boxes.
>
> Now I need to get those values to the corresponding parameters in the
> Pro/E model.
>
> I (think I) need to "get the session" then "get the current model" in
> order to "get the respective parameters" and change them.
>
> Can anyone help with the "getting the session" and "getting the
> current model" parts to get me back on track?
>
> I am using Visual Studio 2008 Express if that makes a difference.
>

>
> The VB text I used is in the attached text file.
>
> Thanks in advance.
>

>
> Rui
>
>
>
> ----------

Ok, never mind, I figured it out.

I made a small function to update the parameters using

(New CMpfcModelItem).CreateDoubleParamValue(CType(valor, Double)

Thanks anyway.

Rui



Rui Vaz wrote:Ok update to this.

Got a handy reference to the manual from Jon Sprang(thanks) but now I'm
stuck (again).

Situation: I've managed to read parameters and their values from the
model to the application.

Now I need to send a value back to a parameter. Any tips on how to do that?

I have the model identified, I have the session connected, I have the
parameter and I have the variable. How do I get the variable's value to
the model's parameter?

Thanks for any clues, the more detailed the better.

Thanks

Rui



Rui Vaz wrote:
Hi everyone

Though my experience with VBA for Excel has allowed me to do what I've
needed so far, VB for Pro/E needs a push.

I'm starting simple: a dialog with 3 text fields to change Length,
Width and Height (comprimento, largura, altura in Portuguese) of a
prismatic part.

On the dialog side, I've managed to get 3 variables converted to
Double from the text boxes.

Now I need to get those values to the corresponding parameters in the
Pro/E model.

I (think I) need to "get the session" then "get the current model" in
order to "get the respective parameters" and change them.

Can anyone help with the "getting the session" and "getting the
current model" parts to get me back on track?

I am using Visual Studio 2008 Express if that makes a difference.



The VB text I used is in the attached text file.

Thanks in advance.



Rui


Hello

I am developing a manual of the Pro/ENGINEER VB API. The course will be offered sometime in February. Did you get problem solved? You can contact me at jfelkins@felcosolutions.com.

Announcements