Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb and catia connection 1

Status
Not open for further replies.

JeniaL

Mechanical
Jun 3, 2014
547
IL
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.
 
Replies continue below

Recommended for you

thanks.
if someone needs a code
feel free to play around with that
Code:
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

Untitled_wpo85y.jpg
 
thanks. having problem with running exe file on another computers because of references. have to try installshield.
 
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.
export_ytozlj.jpg

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

Untitled_bzl6ip.jpg

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
 
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

- Romania
- EU
 
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..
fff_g8xaeq.jpg

looks nice isn't it?

i use for this
 
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
Untitled_ywkn7h.jpg


here's a code
Code:
'----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----
    [highlight #3465A4]'FileFormManufacturing.Value = Product1.UserRefProperties.Item("FILE FOR MANUFACTURING").ValueFromString
    'If Product1.UserRefProperties.Item("FILE FOR MANUFACTURING").ValueFromString = "" Then
    'FileFormManufacturing.Value = "NOT EXISTS"
    'End If[/highlight]
    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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top