Message 1 of 5
VB Application issue

Not applicable
05-27-2010
07:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have upgraded to IV2011... Now my VB application no longer works. The point I am having a problem with is a section that I places a view in an idw, turns on a specific sketch, then adds a dimension to the sketch geometry. The section of code below runs till it gets to the part where I am setting oCurve = oDVi.DrawingCurves(oSketch) filtered to the oSketch. If I remove the filter of oSketch i can obtain all 519 DrawingCurves within the oDVI view. I use a sketch instead with only 4 DrawingCurves in it so that I can always grab the same Curve to add the dimension to... Did something change in the API that would cause this to no longer work? Once the code gets to the oSketch reference it is caught my my error handling Try/Catch/Finally statement for which in my Catch statement I have my application shut down....Thanks for any help...
Public Sub AddDimensionsToView1CCW(ByVal oDVi, ByVal vscale)
ConfigurationLocation = "AddDimensionsToView1CCW"
oRefComps = oDVi.ReferencedDocumentDescriptor.ReferencedDocument
oRefCompDef = oRefComps.ComponentDefinition
Dim oRefCompDefOccs As ComponentOccurrence
oRefCompDefOccs = oRefCompDef.Occurrences.Item(1)
Dim oRefSubComps As ComponentOccurrence
oRefSubComps = oRefCompDefOccs.SubOccurrences.Item(10)
Dim oSketchPartFils As ComponentDefinition
oSketchPartFils = oRefSubComps.Definition
Dim oSketches As PlanarSketches
oSketches = oSketchPartFils.Sketches
oSketch = oSketches.Item(4)
oRefSubComps.CreateGeometryProxy(oSketch, oPlanarSketchProxy)
Call oDVi.SetVisibility(oPlanarSketchProxy, True)
oCurve = oDVi.DrawingCurves(oSketch)
there is more code after this etc. I just wanted to show how I am using the reference....
Thanks Again,
Bill
Public Sub AddDimensionsToView1CCW(ByVal oDVi, ByVal vscale)
ConfigurationLocation = "AddDimensionsToView1CCW"
oRefComps = oDVi.ReferencedDocumentDescriptor.ReferencedDocument
oRefCompDef = oRefComps.ComponentDefinition
Dim oRefCompDefOccs As ComponentOccurrence
oRefCompDefOccs = oRefCompDef.Occurrences.Item(1)
Dim oRefSubComps As ComponentOccurrence
oRefSubComps = oRefCompDefOccs.SubOccurrences.Item(10)
Dim oSketchPartFils As ComponentDefinition
oSketchPartFils = oRefSubComps.Definition
Dim oSketches As PlanarSketches
oSketches = oSketchPartFils.Sketches
oSketch = oSketches.Item(4)
oRefSubComps.CreateGeometryProxy(oSketch, oPlanarSketchProxy)
Call oDVi.SetVisibility(oPlanarSketchProxy, True)
oCurve = oDVi.DrawingCurves(oSketch)
there is more code after this etc. I just wanted to show how I am using the reference....
Thanks Again,
Bill