AlvaroPers
Mechanical
- Nov 29, 2020
- 30
Hello,
When creating a drawing document and adding a new view programmatically, I end up with the Balloon Generation button greyed out.
Instead, if I do the same manually, I can use the "generate balloons command".
Why the button is disabled when I use the code?
Sub CreateISOView(objProduct As ProductStructureTypeLib.Product)
objAppCATIA = GetObject(, "CATIA.Application")
objDrawingDoc = objAppCATIA.Documents.Add("Drawing")
objDrawingRoot = objDrawingDoc.DrawingRoot
objSheet = objDrawingRoot.ActiveSheet
objSheet.PaperSize = DRAFTINGITF.CatPaperSize.catPaperA2
Dim objViews As DRAFTINGITF.DrawingViews = objSheet.Views
Dim objView As DRAFTINGITF.DrawingView = objSheet.Views.Add("Vista")
Dim oViewLink As DRAFTINGITF.DrawingViewGenerativeLinks = objView.GenerativeLinks
Dim objGenerative As DRAFTINGITF.DrawingViewGenerativeBehavior = objView.GenerativeBehavior
oViewLink.AddLink(objProduct)
objGenerative.DefineIsometricView(-0.7, 0.7, 0, -0.4, -0.4, 0.81)
objGenerative = objView.GenerativeBehavior
objGenerative.Update()
End Sub
My purpose is to crate a isometric view with the code above, and then call the "Start command" c:Balloons
When creating a drawing document and adding a new view programmatically, I end up with the Balloon Generation button greyed out.
Instead, if I do the same manually, I can use the "generate balloons command".
Why the button is disabled when I use the code?
Sub CreateISOView(objProduct As ProductStructureTypeLib.Product)
objAppCATIA = GetObject(, "CATIA.Application")
objDrawingDoc = objAppCATIA.Documents.Add("Drawing")
objDrawingRoot = objDrawingDoc.DrawingRoot
objSheet = objDrawingRoot.ActiveSheet
objSheet.PaperSize = DRAFTINGITF.CatPaperSize.catPaperA2
Dim objViews As DRAFTINGITF.DrawingViews = objSheet.Views
Dim objView As DRAFTINGITF.DrawingView = objSheet.Views.Add("Vista")
Dim oViewLink As DRAFTINGITF.DrawingViewGenerativeLinks = objView.GenerativeLinks
Dim objGenerative As DRAFTINGITF.DrawingViewGenerativeBehavior = objView.GenerativeBehavior
oViewLink.AddLink(objProduct)
objGenerative.DefineIsometricView(-0.7, 0.7, 0, -0.4, -0.4, 0.81)
objGenerative = objView.GenerativeBehavior
objGenerative.Update()
End Sub
My purpose is to crate a isometric view with the code above, and then call the "Start command" c:Balloons