Solved! Go to Solution.
Solved by marin_israel. Go to Solution.
Hi,
It looks it works to me. I used the following small code to give a test.
Public Sub GetSingleSelection()
' Get a feature selection from the user
Dim oObject As Object
Set oObject = ThisApplication.CommandManager.Pick(kSketchProfileFilter, "Pick a path")
MsgBox "Picked: " & oObject.Type
End Sub
Thanks to test it for me!!
But, I have the same error... When I execute the "Pick" line, I can click on my profile in IV2013 but VS2010 raise the "nullreferenceexception" Check attach file.
I don't understand why...
Need update, option in IV or something?
sorry, I am not familar with the language you are written in. It looks it reported Pointer is invalid? I am not sure how the problem is caused from. I'd suggest you share a demo code, instead of a code snippet. In addition, goApp is not Nothing, right?
Thanks to help me...
You make me realize that's just a problem of context... I reorder my code and it works fine!
You have to be in sketch context... not in part.
Hi,
I tested my new informations about profile and pick fonction... and I conclude I can only do the pick(profile) in part open and not in part modification(in assembly context)... it is normal? Because it's annoying to demand to users to draw the sketch in context and after open the part to select the profile.
And when I do a extrude feature with this profile: the feature have a weird behavior. When I delete the feature, it's impossible to delete the sketch at the same time. As the feature and the sketch are not link...
In addition, if I do the extrude feature with the profile of addforsolid, everything is allright! I can have the profile in assembly context and when I delete the feature: the sketch is delete too.
Anyone can help me?
Thanks!!
Hi,
the situation push me to test the selection of a profile...
Can you can test it with this example... I put in zip file: .iam, .ipt and 2 demo code(Part context and Assembly context)
I have 2 way to do it as I say in my previous post:
-Assembly context (part edit only) -> pick command crash
-Part context (part open)->pick command works but if I close all, re-open the assembly and make a change on the base extrude of the part... the extrude with the profile(hole in the base extrude) get with the pick command give error... It's hard for me to explain, please check my example.
In my case, the assembly context is more interesting.
Thanks to take time for me, it's really important for my project!