Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATScript to fill in compass parameters

Status
Not open for further replies.

JayEnn1

Automotive
Sep 29, 2015
50
Good morning!

I searched this forum, my Ziethen book, and the portable script by Ferdo and do not
see how to manipulate the compass parameters via macro.

What I wanted to do is to fill in the Increments section: Along U Along V, Along W,
and the rotation boxes with some standard values.

If you can clue me in to the commands used in modifying the compass parameters
I can write the rest of the macro. ( or let me know if it is even an option )

Thanks!
 
Replies continue below

Recommended for you

Some of the details we have in our tooling designs need to be on
even 25mm xyz positions. 0, 25, 50, 75, etc.. So, we fill in the
Compass parameters along U V W with a value of 25 then drag the
detail around to where we want it.

We do this type of thing with other details but move them around
in other various increments to keep their 3D positions on even
metric positions. Helps a lot with builders and dealing with even
numbers than numbers with odd decimal values like 23.76. Prefer 23.00
 
you can always use WIN API...

Eric N.
indocti discant et ament meminisse periti
 
I did consider trying Send Keys option but decided to investigate a more direct fill in
the box approach. I have dabbled with Send Keys once before and unless I was doing something
wrong the results were not consistent. ( keys didn't always send.. )

I'll investigate a send keys approach.
Thank you!
 
Hello JayEnn1,
I need exactly the same thing and I think the correct approach would be to manipulate the position matrix. Search in portable script after rotation and you will find there one example. Unfortunately, I am not able to manipulate the position matrix as I need :( but I plan to invest more time in it.
If you have progress with the send keys, please post it so I can use it myself :)
 
Thank you Iscariot!

I looked briefly at the rotation script. Hopefully later this week I will dig deeper
into your suggestion. I have some work that needs to get done first before scripting.

I did dabble with send keys a little bit. I need to read thru some more examples to
figure it out.

I did see on the internet, COE website, the code below but couldn't get it working.
Kept stopping at AppActivate instruction.


Sub CATMain()

CATIA.DisplayFileAlerts = False

CATIA.HSOSynchronized = False

CATIA.StartCommand ("Edit Compass")

AppActivate "CATIA V5"

CATIA.HSOSynchronized = True

SendKeys "+{TAB}", True
SendKeys "{ENTER}", True
SendKeys "{TAB}", True
SendKeys "^A", True
SendKeys "{DEL}", True
SendKeys "{1}", True
SendKeys "{TAB 3}", True
SendKeys "90", True
SendKeys "{TAB 3}", True
SendKeys "{1}", True
SendKeys "{TAB 3}", True
SendKeys "90", True
SendKeys "{TAB 3}", True
SendKeys "{1}", True
SendKeys "{TAB 3}", True
SendKeys "90", True
SendKeys "{TAB 9}", True
SendKeys "{ENTER}", True

End Sub

This one resets everything to zero

Sub CATMain()

CATIA.DisplayFileAlerts = False

CATIA.HSOSynchronized = False

CATIA.StartCommand ("Edit Compass")

AppActivate "CATIA V5"

CATIA.HSOSynchronized = True

SendKeys "+{TAB}", True
SendKeys "{ENTER}", True
SendKeys "+{TAB}", True
SendKeys "{ENTER}", True

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor