CatiaV5 release 26 VBA Design.Geometrical - vba

While executing the VBA macro script for the English language the macro works properly. Instead for German language CATIA V5 release 26 it does not work. The error occurs at this point in the code
SelectionRoot.Search "Part Design.Geometrical Set.Name=Attribute,sel"
I think it should be a compartibility issues

The search syntax is specific to the user interface language the user is using. You have to give the German CATIA words for "Geometrical Set".
Unfortunately it is not simple to determine which language a user is using or switch for running a macro.
I have to detect between English and Japanese and I can do this by reading the FrameGeneral.CATSettings file, looking for the line which has "UserInterfaceLanguage" in it and measuring the length of the line. If it is 70 that means Japanese. If not we assume English. German might be different.

Related

NaturalDoc problem while generating documentation for VBA module

I hope you're doing well
I am working with NaturalDoc version 2.1.1, to generate documentation for VBA Module
The problem is when I use accented character in VBA comments, the result is some wierd character, like question mark in black small lozenge
I think the problem is in encoding, between VBA module (having the extension .bas) and NaturalDoc
How can I fix the problem ?

Programming with Jolie?

I need to use the programming language "Jolie" for a school project, and I installed the interpreter successfully. But now I dont know how to actually code with this language. Especially in what IDE. I tried to do it with the CMD in Windows (just created a new file "test.ol" with a simple "Hello World" command in it and executed it with "jolie test.ol") but it didnt work.
All I get is the following:
jolie.lang.parse.ParserException: C:\Users\Marco\test.ol:2: error: Invalid token encountered. Found token type ID, token content â
at jolie.lang.parse.AbstractParser.throwException(AbstractParser.java:241)
at jolie.lang.parse.OLParser._parse(OLParser.java:223)
at jolie.lang.parse.OLParser.parse(OLParser.java:185)
at jolie.Interpreter.buildOOIT(Interpreter.java:1251)
at jolie.Interpreter.init(Interpreter.java:1053)
at jolie.Interpreter.run(Interpreter.java:1139)
at jolie.Jolie.main(Jolie.java:60)
Does anybody have a clue for me how to actually use this language? I would prefer an IDE like IntelliJ or Eclipse. Or are their any extensions for this language in a common IDE?
Thanks in advance!
You may have some character enconding issues. Are you copying and paste the code? If so, don't!
Just type in the code yourself in any editor, notepad or just nano. It should work then!
As woland noted, it's an encoding issue, which is that
Found token type ID, token content â at
at the beginning of the error trace.
Regarding IDEs, there are some plugins that provide syntax highlighting, syntax checking, etc. for editors like Atom, Sublime Text, and Kate. You can find instructions clicking on the "Editors & Plug-ins" tab under the Downloads page on the Jolie website.

Is there VBA syntax highlighting for opening and closing loops and if statements?

Sorry if this has been asked before but I can't seem to find any information on this. I am working with VBA for automating word documents and I have this huge block of code with tons of "if else" statements, "do while" loops and "with" statements all nested together.
When I program using other languages and other IDE's, I can normally click the opening "if" or "while" bracket and get the highlighted closing bracket. This makes it a lot easier to keep track of everything. Is there anything close to this functionality in VBA for Word? I am going mad trying to keep track of everything!
I'm not sure it has what you are looking for, but Rubber duck for VBA has some pretty awesome features to upgrade the VBA IDE.
EDIT:
Two more things to try:
Smart Indenter - this one might actually help you more, as it creates intendation, thus helping to identify structures.
MZ-Tools - not free, but has a 30 day trial. (I haven't tried this one - report back if it is any good :) )
Take a look at the Eclipse Colorer plugin which supports e.g. folding and if-then-else-end highlighting etc.:

Tera Term Scripting, need help developing a macro

I am using a Tera Term over a serial port to do some testing on a board. Recently I found out I can do some scripting in Tera Term so I have been doing research to help automate and make testing a little easier.
I know Tera Term has a site that lists example macros as well as a command list but I guess what I need is someone with experience scripting in Tera Term.
Tera Term uses a sort of Basic language called Tera Term Language (TTL) but I found it hard from the site to actually identify which commands I needed to use.
Tera term site: http://ttssh2.sourceforge.jp/ < -- Note: Site is in Japanese but I always have it auto translated...
I am trying to develop a script to play a set of tracks using a "play x" command, where x is the track index. Ideally the track will play for ~3 seconds and then increment up to the next track. I have a very crude outline algorithm that I should describe it.
Algorithm:
;start
;input to take in number of track to test n tracks
;input is stored in "n"
i=0
do while i < (n+1)
;play track i for 3 seconds
i++
end while
;stop
If anyone has any insights or experience with Tera term I would be very appreciative.
If anything right now I need to figure out how to take an inputbox input and store it to a variable. I can probably figure out the rest...
Thanks
OK, I did some digging and found a moderately active forum: http://logmett.com/forum/
It is there that I found a nice thread called: TeraTerm Macro Language for dummies...
http://logmett.com/forum/viewtopic.php?f=3&t=2133
That, and the command list on the actual TeraTerm project site is where I have been troubleshooting and solving 90% of my issues.
To take in a user defined input you use the "inputbox" command, which follows the format:
inputbox 'message' 'title' [default]
(not entirely sure what default is supposed to be doing)
E.G.
inputbox 'Please type input' 'Input'
a dialog box will appear and prompt a response. This input is sent to a default variable inputstr
I have gotten this variable to work in some cases but I think the problem is that the variable is technically a string type so I can't do traditional loops. I need to figure out a way to use the str2int command to do an expression.
I think that answers my own immediate question as well as provide some reference for others...
Thanks

Object Not Set Error on MbeRefFiles in Microstation Macro

I have a Microstation macro that reads the reference files in the current drawing and then prints them to a text file. We are working on getting this running for the new Microstation v8i (upgrade from v8). The macro normally runs through each reference file (from index = 1 to MbeRefFiles.maxRefFiles) and finds the active reference for output.
Now instead, it keeps throwing an Object variable not Set error when referencing the MbeRefFiles(index) object. I'm just doing a Set refFile = MbeRefFiles(index) and it says MbeRefFiles isn't set, which doesn't make sense because it doesn't need to be set. The macro is completely unchanged and has been working for years, and now suddenly it can't read the reference file object. Anyone have any insights?
As far as I know, you have to use VBA than you can get more comfortable support.Microstation's VBA is based on Microsoft's engine while MBE is cooked by Bentley.
MicroStation BASIC became obsolete in 2001 when Bentley Systems released MicroStation v8.
Prefer to use MicroStation VBA. It fully supports MicroStation V8 where MicroStation BASIC falls short. MbeRefFiles.maxRefFiles is an example of the shortcomings of MicroStation BASIC. MicroStation VBA provides a collection (ModelReference.Attachments) that you can iterate using VBA idioms.