Inventor.Selection Not Defined
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm trying to create some simple iLogic code using an object-oriented interface. Specifically, I'm trying to use the Inventor.Selection class in an Inventor parts (IPT) file. I'm trying to write a rule that when launched will ask the user to select a sketch, at which point the user would select a sketch. There are a few things that I need to do to the sketch including identifying each line as an individual vector and splitting it up into 24" segments with the remainder left at the end of each line. To first step is using the Inventor.Selection code and for some reason I keep getting the error listed below. I've tried putting "Imports Inventor" in the header of the iLogic rule but I still get the same error.
I noticed that if I uncheck the "Straight VB Code" option, I get this error.
If I check the "Straight VB Code" then I get the following errors.
Any help would be much appreciated. Sample code listed below:
Dim sel As Inventor.Selection sel = invApp.ActiveDocument.SelectSet sel.Select(Nothing, "Select a Sketch") If sel.Count > 0 Then Dim sketch As Inventor.Sketch = sel(1) MsgBox("You selected the sketch: " & sketch.Name) End If