hi,
wich command do I use in rhino to select all the arcs in a drawing, because I want to put them in a different layer.
The same for circles
thanks
edward
hi,
wich command do I use in rhino to select all the arcs in a drawing, because I want to put them in a different layer.
The same for circles
thanks
edward
Hi Edward- here is an ancient RhinoScript that may help- save, unzip, then drag and drop the rvb file onto Rhino to add the following aliases-
SelArc
SelCircle
SelArcRad (by radius)
SelCircleRad
SelArc (2).zip (880 Bytes)
Does that do anything useful?
-Pascal
Thanks
I already found something and that was the same solution, I think also from you.
only drag and drop isn’t working.
I have only to open rhino 4 and than drag it into?
edward
Hi Edward - that should work- Unzip, save, and then drag and drop from the saved location (not from the zip file) onto Rhino… any luck?
-Pascal
not in a certain directory, map?
edward
In the past I did devsrf into rhino but that is a .rhp file
Hi pascal
thank you very much .
it is working.
is there a list of rvb files, for the future??
did you see my other question of this day?
regards edward
Hi Pascal,
I can’t download the script anymore and I can’t get it working in Rhino6
happy new year
Edward
Try this one?
SelArc.py (466 Bytes)
Is this one also for circle’s?
No, circles are considered separately (by me anyway) Below is a recent post with several “objects by type” selection scripts.
Hi Pascal, just wondering if this script (at the start of the thread) is still available somewhere as the current link seems to be invalid?
SelArc
SelCircle
SelArcRad (by radius)
SelCircleRad
Cheers
Alex
Hm. I cannot find it - I’ll make some more.
-Pascal
Thanks Pascal.
Seems they are just the scripts we are looking for.
Cheers
Alex
@alexbabaeff - see how this works for you- I shoved it in with a bunch of other curve utlities in this plug-in:
CurveAndArcUtilities.rhp (61 KB)
You’ll need to unblock the rhp in Windows, then drag and drop it onto Rhino. It has a bunch of commands, some of which might be useful
3PtArcFromPoints
3PtArcFromPolyline
ArcFitToCurve
ArcFitToPoints
ArcFitToPolyline
RadiusFrom3Pts
SelArc
SelArcByRadius
SelCircle
SelCircleByRadius
SetArcDegrees
SetArcRadians
SetCurveLength
SubCrvFromMid
-Pascal
Awesome, thanks Pascal
Cheers
Alex
I also have two commands for selecting arcs and circles that I found in this forum several years ago. You just need to paste these into the “Command” filed of the icon:
Tooltip:
Select arcs
Command:
! _NoEcho _-Runscript (
Option Explicit
Call SelArcs()
Sub SelArcs()
Dim arrAllObjs,strObj,entity,i : i=0
arrAllObjs=Rhino.NormalObjects
If Not IsArray(arrAllObjs) Then Exit Sub
Call Rhino.EnableRedraw(False)
'Call Rhino.UnselectAllObjects
For Each strObj in arrAllObjs
If Rhino.IsArc(strObj) Then
Call Rhino.SelectObject(strObj)
i=i+1
End If
Next
entity="arc"
If i<>1 Then entity=entity&"s"
If i>0 Then
Call Rhino.Print(i&" "&entity&" added to selection")
Else
Call Rhino.Print("No "&entity&" found, nothing added to selection")
End If
Call Rhino.EnableRedraw(True)
End Sub
)
Tooltip:
Select circles
Command:
! _NoEcho _-Runscript (
Option Explicit
Call SelCircles()
Sub SelCircles()
Dim arrAllObjs,strObj,entity,i : i=0
arrAllObjs=Rhino.NormalObjects
If Not IsArray(arrAllObjs) Then Exit Sub
Call Rhino.EnableRedraw(False)
'Call Rhino.UnselectAllObjects
For Each strObj In arrAllObjs
If Rhino.IsCircle(strObj) Then
Call Rhino.SelectObject(strObj)
i=i+1
End If
Next
entity="circle"
If i<>1 Then entity=entity&"s"
If i>0 Then
Call Rhino.Print(i&" "&entity&" added to selection")
Else
Call Rhino.Print("No "&entity&" found, nothing added to selection")
End If
Call Rhino.EnableRedraw(True)
End Sub
)
@Rhino_Bulgaria If you are going to post code, it’s best to format it so that people can copy/paste it correctly so it’s usable. To do so, enclose the code with 3 “backticks” above and below like this:
```python
<paste your code in here>
```
Adding the python label will also format it with more less standard python formatting and colors; there are labels for most common languages.
The scripts above are mine - old .rvb scripts which will only run on Windows - but since Pascal already posted his in a plug-in I didn’t post them in this thread. Here are the python equivalents:
SelArc.py (466 Bytes)
SelCircle.py (474 Bytes)
SelSameRadArcsCircles.py (3.0 KB)
SelByRadius.py (2.8 KB)
Thanks! I didn’t knew about the Python special code. Seems to work now in my edited post above.
By the way, your scripts for selecting arcs and circles are priceless and I use them quite often.
Cheers,
Bobi
As the old scripts are written in vbscript, which apparently the version of Markdown used here does not support the syntax highlighting, you can just leave off the python label…
```
<code>
```
Then it looks like this:
Option Explicit
Call SelCircles()
Sub SelCircles()
Dim arrAllObjs,strObj,entity,i : i=0
arrAllObjs=Rhino.NormalObjects
If Not IsArray(arrAllObjs) Then Exit Sub
Call Rhino.EnableRedraw(False)
'Call Rhino.UnselectAllObjects
For Each strObj In arrAllObjs
If Rhino.IsCircle(strObj) Then
Call Rhino.SelectObject(strObj)
i=i+1
End If
Next
entity="circle"
If i<>1 Then entity=entity&"s"
If i>0 Then
Call Rhino.Print(i&" "&entity&" added to selection")
Else
Call Rhino.Print("No "&entity&" found, nothing added to selection")
End If
Call Rhino.EnableRedraw(True)
End Sub
That’s the best I think you can do with vbscript here, it would be nice if it looked like this though: