3DCADWorld Network | 3DCADTips | 3DCADTutorials | 3DCADForums | 3DCADSearch | 3DCADBooks | Design World






Get CAD tips and tutorials on your desktop when you register at 3DCADTips.com!

3DCADTips Weekly
Latest Issue
Archive

3DCADTips Forum Update
Latest Issue
Archive






Visit 3DCADSearch.com - The CAD & Graphics Search Engine!!




  #1 (permalink)  
Old March 4th, 2008, 07:50 AM
dbwalters dbwalters is offline
Junior Member
 
Join Date: Feb 2008
Posts: 4
Question Setting the Tools->Options

Hello, I have written a CATSCRIPT that will change the unit parameter LENGTH from INCH to MILLIMETER (or vice-versa). This change happens when a button is selected on the user's toolbar. The button will save the user some time since he/she doesn't have to access TOOLS->OPTIONS each time to change this parameter. Even though the change actually takes effect, CATIA doesn't think that anything has happened. When I go to verify the change in TOOLS->OPTIONS->PARAMETERS AND MEASURES->UNITS I can see it has taken place, but, it is not until I hit the 'OK' button on that panel that CATIA recognizes it.
Does anyone have an idea on what I can do in my code to provide the same authorization as the 'OK' button? Is there an "update" that I am missing?

Below is a copy of the VBSCRIPT I am using:

Code:
Language="VBSCRIPT"

Sub CATMain()
     Dim oSettingControllers As SettingControllers
     Set oSettingControllers = CATIA.SettingControllers

     Dim oUnitsSheetSettingAtt As SettingController
     Set oUnitsSheetSettingAtt = oSettingControllers.Item("CATLieUnitsSheetSettingCtrl")

     Dim oMagnitude as String
     oMagnitude = "LENGTH"

     Dim oUnit as String
     oUnit = ""

     Dim oGetDecimal as Double
     Dim oGetExpo as Double

     oUnitsSheetSettingAtt.GetMagnitudeValues oMagnitude, oUnit, oGetDecimal, oGetExpo

     If (oUnit = "Inch") Then
          Dim oUnitInch as String
          oUnitInch = "Millimeter"
          oUnitsSheetSettingAtt.SetMagnitudeValues oMagnitude, oUnitInch, 6.000000, 3.000000
          oUnitsSheetSettingAtt.SaveRepositoryForUnits()
          oUnitsSheetSettingAtt.CommitForUnits()
          MsgBox "The Current Unit is now: " & oUnitInch
     End If

     If (oUnit = "Millimeter") Then
          Dim oUnitMM as String
          oUnitMM = "Inch"
          oUnitsSheetSettingAtt.SetMagnitudeValues oMagnitude, oUnitMM, 6.000000, 3.000000
          oUnitsSheetSettingAtt.SaveRepositoryForUnits()
          oUnitsSheetSettingAtt.CommitForUnits()
          MsgBox "The Current Unit is now: " & oUnitMM
     End If

End Sub
Any information or assistance that you can provide would be appreciated.

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Link


  #2 (permalink)  
Old March 4th, 2008, 08:25 PM
MrCATIA MrCATIA is offline
Moderator
 
Join Date: Jul 2006
Location: Maryland, USA
Posts: 270
Default

try these links for some suggestions:

Question: Creating UserForms - CATScript - CATIAV5 Forum

http://www.coe.org/Collaboration/Dis...4/Default.aspx

Last edited by MrCATIA : March 4th, 2008 at 09:01 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old March 6th, 2008, 03:19 PM
dbwalters dbwalters is offline
Junior Member
 
Join Date: Feb 2008
Posts: 4
Default thanks for the ideas

Thanks for the additional ideas. The one link is to a thread of mine that I posted on the COE website. I am seeing if anyone has any answers over there...So far, no luck either. I keep trucking on trying to find a resolution.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old March 19th, 2008, 06:50 AM
dbwalters dbwalters is offline
Junior Member
 
Join Date: Feb 2008
Posts: 4
Default

I believe that I found a solution to my problem. All that was needed was the following two lines of code:

CATIA.StartCommand("Options...")
CATIA.ActiveWindow.Close

Now everything works. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 08:30 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0