×
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

CATIA.SystemService.ExecuteScript problem

CATIA.SystemService.ExecuteScript problem

CATIA.SystemService.ExecuteScript problem

(OP)
Hello All

I'm trying to use below code to run CATVBS code from VBA. It throws an error that "Function or interface marked as restricted or function uses an automation type is not supported in VB"


CODE --> VB

Sub CATMain()

Dim EmptyPar()
Dim ScPath

Path = "C:\tmp"

CATIA.SystemService.ExecuteScript Path, catScriptLibraryTypeDirectory, "macro1.catvbs", "CATMain", EmptyPar

End Sub 


☺- catScriptLibraryTypeDirectory is correct for catvbs????? or

do i need some settings to be changed.


regards

RE: CATIA.SystemService.ExecuteScript problem

(OP)
there is a typo , please read Dim Scpath as Dim Path .. sorry

(my CAD workstation is in different network from my mailing system. so can not copy paste my codes exactly. i have to retype all the code to post a thread in forum. smile )



RE: CATIA.SystemService.ExecuteScript problem

(OP)
Guys never mind I solved it.i used this

CODE --> VB

Call vSystemService.ExecuteScript("C:\Temp", catScriptLibraryTypeDirectory, "SetPartNumber.CATScript", "CATMain", params) 

RE: CATIA.SystemService.ExecuteScript problem

(OP)
Hello fernando,

Iam still executing catvbs.

1) I did early binding on CATIA.SystemService then used "Call".
2) params empty ie. Dim Params ()
3) catScriptLibraryTypeDirectory is correct for catvbs and CATscript

Problem solved smile

regards
var

RE: CATIA.SystemService.ExecuteScript problem

(OP)

you are right. problem was with script line that calling catvbs..

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