×
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 VBSCRIPT planar sections an multiple apply

CATIA VBSCRIPT planar sections an multiple apply

CATIA VBSCRIPT planar sections an multiple apply

(OP)
Ok guys here is the problem, I'm trying to simplify my code to avoid unwanted mistakes to happen, because there are still problem using catia with the Sleep function(my computer sometimes is slow)
To simplify my code which is meant to create planar sections of an element using various planes, im currently transforming the code to call the planar section just once and not everytime i have a different plane.
BUT... Catia doesn't like it... at all

I can make the first section, make that the panel of planarSections stays activated but when I select another plane to apply the section on, it selects it but doesn't use it for the section ?!
If you have any idea to help me solve my problem I'll be gratefull.

Here is the code i use

CODE -->

CATIA.StartCommand "Planar Sections"

				WScript.Sleep 100

				oSelection.Search "Name=" & namer ' name of the element to apply the section on

				WScript.Sleep 200

				oSelection.Search "Name=plane0" 'selection of the first plane with which one will be applied the section

				WScript.Sleep 200

				for i=0 to 14    ' loop to reqch the apply button

					WshShell.SendKeys "{TAB}", TRUE

					WScript.Sleep 100

				Next

				WshShell.SendKeys "{ENTER}", TRUE  ''sendkey enter to "clic" on the apply button previously selected

				WScript.Sleep 400

				For j = 1 to (num-1)  ' loop to select the other planes created before this part of code an apply the section for all of them 

					oSelection.Clear

					WScript.Sleep 100

					oSelection.Search "Name=plane" & CLng(360/num*j)

					tggt = oSelection.count

					WScript.Sleep 200
					
					WshShell.SendKeys "{ENTER}", TRUE

					WScript.Sleep 200

				Next
				
				for i=0 to 15 'loop to reach the OK button

					WshShell.SendKeys "{TAB}", TRUE

					WScript.Sleep 100

				Next
		
				WshShell.SendKeys "{ENTER}", TRUE ' clic on OK button

				WScript.Sleep 100

				oSelection.Search "Name=" & "Planar Sections." & "*, all"  'select all the created sections to hide them

				WScript.Sleep 200

				Set VisPropertySet1 = oSelection.visProperties

				VisPropertySet1.SetShow 1 ' hidding the selcion

				WScript.Sleep 200

				oSelection.Clear 

RE: CATIA VBSCRIPT planar sections an multiple apply

(OP)
up?

RE: CATIA VBSCRIPT planar sections an multiple apply

(OP)
I found a solution

A bit tricky but, whatever... works just perfectly
I had just to activate the selection , and for that I used WshShell.SendKeys "c:FrmActivate" + "{ENTER}", True just after the selection

CODE -->

For j = 1 to (num-1)

					oSelection.Clear

					WScript.Sleep 100

					oSelection.Search "Name=plane" & CLng(360/num*j)

					WshShell.SendKeys "c:FrmActivate" + "{ENTER}", True

					WScript.Sleep 200

Next 

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