VB Application issue

VB Application issue

Anonymous
Not applicable
511 Views
4 Replies
Message 1 of 5

VB Application issue

Anonymous
Not applicable
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
0 Likes
512 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Nothing should've changed in Inventor 2011, but I think you need to pass in
the sketch proxy (oPlanarSketchProxy) instead of oSketch.

Sanjay-
0 Likes
Message 3 of 5

Anonymous
Not applicable
Sanjay,

Thanks for the response. I now works with the oPlanarSketchProxy.... I'm just surprised as is has worked as I presented it since IV2009. I'm not sure why.. Would you know?

Thanks,
Bill
0 Likes
Message 4 of 5

Anonymous
Not applicable
It should never really have worked with the sketch input (all methods on the
drawing view that accept model entity inputs require them to be specified in
the context of the top level document). It's possible that a fix for some
other issue caused this change in behavior - the current behavior being the
right one.

Sanjay-
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thanks Sanjay.... funny how goofy things like that happen... \;^)

Bill
0 Likes