×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

vb and catia connection

vb and catia connection

vb and catia connection

(OP)
saw on many macros when form runs it first checks for connection with catia and if connection is ok some text or button turns green or no matter what color. cat anybody share a code for VBA/VB6? how to get catia i know but can't figure out how to change button color.

thanks in advance,
cheers.

RE: vb and catia connection

Use the Button.BackColor property

RE: vb and catia connection

(OP)
thanks.
if someone needs a code
feel free to play around with that

CODE --> vba/vb6

Sub UserForm_Initialize()
    NewDocBox.List = Array("PART", "DRAWING", "PRODUCT")
    SaveAsList.List = Array("PART", "DRAWING", "PRODUCT")
    
    lngGreen = RGB(102, 204, 0)
    lngRed = RGB(255, 0, 0)
    On Error Resume Next
    Set MyCATIA = GetObject(, "CATIA.Application")
    If Err.Number = 0 Then
    ConnectionStatus.Caption = "CONNECTED TO CATIA V5"
    ConnectionStatus.ForeColor = lngGreen
    Else
    ConnectionStatus.Caption = "NOT CONNECTED TO CATIA V5"
    ConnectionStatus.ForeColor = lngRed
    End If
    
End Sub 

RE: vb and catia connection

Nice, thanks for sharing

RE: vb and catia connection

JeniaL, very good..

RE: vb and catia connection

(OP)
thanks. having problem with running exe file on another computers because of references. have to try installshield.

RE: vb and catia connection

(OP)
i know there are some programs/macros that can export text to part but the reason i got this one is catia composites.
we have to put some label on a plies so fabric cutting machine can write it on a ply. since Catia don't have too much options for creating label i did it thru macro.

for example in option for flatten geometries missing prefix and suffix. Dassault Systemes already got email from me.

thru a macro i can easily add what i want..
cheers...


created in vb6

Ferdo thanks a lot for a part of your code...

p.s again not running on another PC
NOT WORKING WITH CATIA V5R25 SP2..I'M RUNNING V5R25 SP3 HX3

RE: vb and catia connection

Star from me for sharing your experience.

Did you checked on those computers if you have all references used by your programs? For example ocx files....

Just a suggestion...try to move on VS2010Express (for example), is free... do your applications portable and include the references in same folder like your exe file...so you will avoid problems...

One of reasons I'm still using catvbs or catscript (even if you can't do nice UI) is this one, I'm not depending so much of CATIA release...

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: vb and catia connection

(OP)
hi guys..completely changed design of my forms from buttons to images and now having problems with simulating button click action.. i use BorderStyle inside of my code but seems like it's not working. how do i force image to act like a button? any help will be really appreciated..

the reason i switched from buttons to images is just cool design..

looks nice isn't it?

i use http://buttonoptimizer.com for this

RE: vb and catia connection

(OP)
trying to improve my program and stuck with reading Product added properties. can't get a value of them.
everything work fine with regular properties


here's a code

CODE --> VB6

'----GET FILE REVISION----
    REV.Value = Product1.Revision
    If Product1.Revision = "" Then
    REV.Value = "NOT FILLED"
    End If
    
    '----GET TITLE----
    DESCR.Value = Product1.DescriptionRef
    If Product1.DescriptionRef = "" Then
    DESCR.Value = "NOT FILLED"
    End If
    '----END----
        
    '----GET FILE FOR MANUFACTURING----
    'FileFormManufacturing.Value = Product1.UserRefProperties.Item("FILE FOR MANUFACTURING").ValueFromString
    'If Product1.UserRefProperties.Item("FILE FOR MANUFACTURING").ValueFromString = "" Then
    'FileFormManufacturing.Value = "NOT EXISTS"
    'End If
    Status.Caption = "IDLE..."
    End Sub 

i read properties at form initialize. highlighted code doesn't works for me.

any help will be appreciated.

cheers,

Jenia

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources