Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Switch off the Sketcher grid

Status
Not open for further replies.
Replies continue below

Recommended for you

Drawing grid on/off is a user option that can be controlled by the CATSettings. I don't think it is controlled by automation.
 
Hi Jackk,
Thanks for your quick response.I did not find any API help in any document nor did my macro get recorded when I switched off Drawing Grid .So,Do you think we cant do via coding?
 
Hi,

jackk is right up to a point. Sometime you need to do dirty workaround to achieve what you want.

Code:
Sub CATMain()

Dim settingControllers1 As SettingControllers
Dim settingRepository1 As SettingRepository
Dim boolean61 As Boolean

Set settingControllers1 = CATIA.SettingControllers
Set settingRepository1 = settingControllers1.Item("DraftingOptions")

boolean61 = settingRepository1.GetAttr("Drw_settings_GridDisplay")

If boolean61 Then
settingRepository1.PutAttr "Drw_settings_GridDisplay", False
Else
settingRepository1.PutAttr "Drw_settings_GridDisplay", True
End If

MsgBox settingRepository1.GetAttr("Drw_settings_GridDisplay")

settingRepository1.Commit

Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument

Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets

Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.ActiveSheet

Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views

Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Add("Tempo")

Dim drawingViewGenerativeBehavior1 As DrawingViewGenerativeBehavior
Set drawingViewGenerativeBehavior1 = drawingView1.GenerativeBehavior

drawingViewGenerativeBehavior1.DefineFrontView 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000

drawingView1.x = 0
drawingView1.y = 0

Dim double1 As Double
double1 = drawingSheet1.Scale

drawingView1.Scale = 1.000000
drawingView1.Activate 

Dim selection1 As Selection
Set selection1 = drawingDocument1.Selection

selection1.Search "Name=Tempo,all"

	Dim selection2 As Selection
	Set selection2 = drawingDocument1.Selection

 selection2.Delete

End Sub

Regards
Fernando

- Romania
- EU
 
Hi Ferdo,
Thanks for your reply.I have written your code exactly but still the Sketcher grid did not turn off.I have a Active CATIA Drawing Document,I have written the below code.but nothing has been achieved
Waiting for your reply

Dim settingControllers1 As SettingControllers = CATIA.SettingControllers
Dim settingRepository1 As SettingRepository
settingRepository1 = settingControllers1.Item("DraftingOptions")
Dim boolean1 As Boolean
boolean1 = settingRepository1.GetAttr("Drw_settings_GridDisplay")
If boolean1 = True Then
settingRepository1.PutAttr("Drw_settings_GridDisplay", False)
Else
settingRepository1.PutAttr("Drw_settings_GridDisplay", True)
End If

settingRepository1.Commit()
 
Sorry Ferdo.Initially,I thought its working,but Its not working..Please let me know the correct process for switching off Sketcher Grid.

Waiting for your reply
 
I still dont know Why I am not able to switch off Sketcher Grid after running your code..Can you please tell me the reason and also Y is CATIA.StartCommand("Display Grid") not working here?
 
Hi Ferdo,
Do you have idea of checking Clash,Contact and Clearance between two parts in CATIA..Also,a seconday screen is displayed when you select that Interference feature,Can we export that to "3DXML" File format?

I hope you understood what I meant

Waiting for your reply
 
Hi Ferdo,
My License has been activated but When I am creating Interference features in a product,I am only able to export the whole product to "3DXML" file,I want to export individual Interference windows of 3DXML files..I hope you understand this ..If not,plese tell me so that I will sne dyou screenshots for your better understanding.
 
Hi Ferdo,
In this Product,I have total of 3 parts.There exists a clash between Part 1 and Part 2 as well as a clash between Part 2 and Part 3.When you click on Interference feature 1,a second window pops up;I need to export this window to "3DXML" file. Please find the two Image files attached.First one shows the Interference features(Clash and Clash) in the Tree..

Waiting for your reply
 
 http://files.engineering.com/getfile.aspx?folder=4f1b81b1-cf49-4282-bfef-16b6eb002483&file=Interference.png
Hi Ferdo,
Second Image shows the CATIA Window of the Interference feature(i.e. the model showing only the clash between 2 parts).I want to export this particular window to 3DXML file.Please help me..Hope you understand what I mean.I have highlighted the window in red colour.



Thanking you
 
 http://files.engineering.com/getfile.aspx?folder=1ded6f49-c5e5-41b7-8ce4-da7f4887443e&file=Interference2.png
Status
Not open for further replies.
Back
Top