×
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

Encoding Catia scripts

Encoding Catia scripts

Encoding Catia scripts

(OP)
Hi Gents,
A quick question.
Is it possible to encode small scripts to stop them being altered?

Regards
Alan

RE: Encoding Catia scripts

For catvbs you can obfuscate directly in CATIA, CATScripts no solution, catvba you can put a password.

None of them are very secure, for someone with enough knowledge they can be brake.

More secure is creation of exe files in a programming environment (like vb.net for example).

You can also embed your CATScript or catvbs code in a hta file and make it also exe file.

Regards
Fernando

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

RE: Encoding Catia scripts

(OP)
Thanks Fernando,

I'm getting some translations done and the scripts are named in English but add the German translation.
For example, cap head screw.catscript would add a text box with the German text.
Once there all finished I just didn't want anyone changing anything as a prank.
People could end up putting anything on a few hundred drawings :)

I'll take a look at the hta file and see how involved that will be to do.

Cheers
Alan

RE: Encoding Catia scripts

I would convert CATScripts in catvbs and obfuscate them. You really need some knowledge to unobfuscate them (please correct me if I'm not using the right word for doing the reverse of obfuscation, English is not my native language).

For hta I'm using a free editor which can compile also the hta in exe file.

Regards
Fernando

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

RE: Encoding Catia scripts

(OP)
Thanks Fernando,
I will try the two methods.

Regards
Alan

RE: Encoding Catia scripts

(OP)
Hi,
Another quick one please ( I know I'm becoming a pain :()
As I said I'm using bits of scripts to insert text but I also have a few which change the annotation on some dimensions.
I usually just dimension, say a hole. Highlight it then run a little script to fill in the details.
I have tried to use the Catina start command to try and do the whole thing from scratch
So I just run the script and then click the feature and it will dimension and autofill the annotations I want but I can't get it to work.
Any ideas ?
Thanks
Alan

RE: Encoding Catia scripts

If you have several scripts which you run one after another, you can put them all in a single one. If you want to repeat this, put the actions in a loop and do the job till you push ESC key (there are examples here on the forum).

Hard to give advice without a clear input, CATIA.StartCommand is not the best way to do automation, check documentation please.

Regards
Fernando

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

RE: Encoding Catia scripts

(OP)
Thanks Ferdo.
Here's what I mean,
If I use the catia start command for selecting the dimension it doesn't insert the annotation.
The command may not work that way so I could be flogging a dead horse :(


----------------------------------------------------------------------------------------
Sub CATMain()

Dim documents1
Set documents1 = CATIA.Documents

Set Document = CATIA.ActiveDocument


CATIA.StartCommand "Diameter Dimensions"


Dim selection1
Set selection1 = Document.Selection

Set Info = selection1.Item(1)

Dim Dimension1
Set Dimension1 = Info.Value

Dim DimDimValue
Set DimDimValue = Dimension1.GetValue

DimDimValue.SetFormatName 1, "ANS.DIMM"
DimDimValue.SetFormatPrecision 1, "0.0010" 'precision

Dim oBefore
'oBefore ="Before"

Dim oAfter
oAfter ="-H7 THRO'"

Dim oUpper
'oUpper = "Upper"

Dim oLower
'oLower = "Lower"

Dimension1.GetValue.SetBaultText 1, oBefore, oAfter, oUpper, oLower

Dim myDim 'As DrawingDimension
Set myDim = CATIA.ActiveDocument.Selection.Item(1).Value
Dim myDimLine 'As DrawingDimLine
Set myDimLine = myDim.GetDimLine
myDimLine.DimLineGraphRep = catDimLine2Parts

MyDim.RestoreValuePosition()


End Sub

--------------------------------------------------------------------------------------------------

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