- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I'm having problems with a multiple selection of curves from an Command Dialog.
I din not find any example on the forum or in the documentation so I am asking some help or some example code.
These are extracts from the Add-in I'm trying to write:
Inside the SampleCommandCreatedHandler I have this code
.....................
# Create selection input
curve_input = inputs.addSelectionInput('curve_input', 'Select', 'Select curve')
# select only curves
curve_input.addSelectionFilter('SketchCurves')
# I can select more than one curve
curve_input.setSelectionLimits(0)
.....................
Inside the SampleCommandExecuteHandler I have this code
.....................
# count the number of curves selected
n_selection = inputs.itemById('curve_input').selectionCount
# get the curve selected and call helix()
for i in range (0, n_selection đ
cur = inputs.itemById('curve_input').selection(i)
curve = cur.entity
# call a function witn the curve selected
helix( curve )
I do not understand the reason why I receve this error
If I select 3 curves and use the following instruction
cur = inputs.itemById('curve_input').selection(0)
or
cur = inputs.itemById('curve_input').selection(1)
or
cur = inputs.itemById('curve_input').selection(2)
they do not provide error
Someone can help me ?
Many Thanks
Dino
Solved! Go to Solution.