Switch off the Sketcher grid
Switch off the Sketcher grid
(OP)
Hello Everyone,
In the Drawing Document,I want to switch off the using CATIA VB/CATIA CAA.Please look at the attached figure below:
Thank you
In the Drawing Document,I want to switch off the using CATIA VB/CATIA CAA.Please look at the attached figure below:
Thank you





RE: Switch off the Sketcher grid
RE: Switch off the Sketcher grid
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?
RE: Switch off the Sketcher grid
jackk is right up to a point. Sometime you need to do dirty workaround to achieve what you want.
CODE --> CATScript
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 SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
If someone else have another way, please let me know, I'm always ready to learn something new.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
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()
RE: Switch off the Sketcher grid
The best thing to do is to Use StartCommand()
I have just written this line:
CATIA.StartCommand("Display Grid")
RE: Switch off the Sketcher grid
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
Waiting for your reply
RE: Switch off the Sketcher grid
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
RE: Switch off the Sketcher grid
CATIA.startcommand is not working all the time...
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
RE: Switch off the Sketcher grid
RE: Switch off the Sketcher grid
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
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
RE: Switch off the Sketcher grid
First question: check search function of the forum.
Second question: with the right license, you have different possibilities to export but as far as I know, not 3dxml. Please ask your support or CATIA vendor about license.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Switch off the Sketcher grid
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.
RE: Switch off the Sketcher grid
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
RE: Switch off the Sketcher grid
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
RE: Switch off the Sketcher grid
For Clash Analysis,
This code is working perfectly :
Sub Main()
Dim CATIA As INFITF.Application
CATIA = GetObject(, "CATIA.Application")
If CATIA Is Nothing Then
CATIA = CreateObject("CATIA.Application")
End If
Dim cClashes As Clashes
Dim oSelection As Selection
oSelection = CATIA.ActiveDocument.Selection
Dim oProduct As AnyObject
oProduct = oSelection.FindObject("CATIAProduct")
cClashes = oProduct.GetTechnologicalObject("Clashes")
Dim oClash As Clash
oClash = cClashes.AddFromSel()
oClash.ComputationType = CatClashComputationType.catClashComputationTypeBetweenAll
oClash.InterferenceType = CatClashInterferenceType.catClashInterferenceTypeContact
oClash.Compute()
Dim cConflicts As Conflicts
cConflicts = oClash.Conflicts
Dim count As Integer
count = cConflicts.Count
Dim oConflict As Conflict
Dim Produs1 As Product
Dim oNume1 As String
Dim prod1run As Integer
Dim i As Integer
For i = 1 To count
oConflict = cConflicts.Item(i)
Produs1 = oConflict.FirstProduct
oNume1 = Produs1.PartNumber
If (UCase(Left(oNume1, 3)) = "RUN") Then
prod1run = prod1run + 1
End If
If (oConflict.Type = CatConflictType.catConflictTypeClash) Then
If (oConflict.Value <> 0) Then
oConflict.Status = CatConflictStatus.catConflictStatusRelevant
oConflict.Comment = "Automatic filter : penetration less than "
End If
ElseIf (oConflict.Type = CatConflictType.catConflictTypeContact) Then
oConflict.Status = CatConflictStatus.catConflictStatusIrrelevant
oConflict.Comment = "lalalalalala"
End If
Next
Dim iType As CatClashExportType = CatClashExportType.CatClashExportTypeXMLResultOnly
oClash.Export(iType, "c:\\Temp\ClashReport")
End Sub
End Module
I have 3 Queries:
1)For getting Clashes object,I am using oProduct.GetTechnologicalObject("Clashes")..I know that the method GetTechnologicalObject("Clashes") can be used only on the Root Product,Please help me to find the root Product from the Active Document because I dont want to manually select the root product everytime.
2)What if I have a root product consisting of 13-14 parts and I want to know clash report of each Part with other Parts? Then how should I modify my code
3)Once Interference feature is created in the model tree,If you click on that another window gets popup showing the exact Clash analysis of 2 parts..Will it be possible to export this particular window to "3DXML file"?..I Actually want to export each and every parts Clash analysis window to "3DXML files"
Waiting for your reply
Thank you