Our job is industrial 3D metrology. We often compare nominal coordinates from CAD to measured coordinates. The result looks like this:
In the example above we have vectors that show deviation. Red ist out of tolerance.
The vectors are created with the CurveArrows command in RhinoScript:
Call Main()
Sub Main()
Dim objLine
objLine = Rhino.AddLine(Array(0,0,0), Array(1000,1000,1000))
Rhino.CurveArrows objLine, 2
End Sub
This is useful, but a sreenshot like the one above is often not accepted for a report which the steelbuilder (who is our client) can give to his client.
So we would like to use the _Make2D command. But the CurveArrows are removed (sample below: the top view):
Interesting: The arrows created with _Dim command are still there.
The same will happen, if we export e.g. to DXF or when we use the 3D PDF exporter in PlugIn made by simlab-soft.com. (Minor problems)
My question: how can I create arrows in RhinoScript which will remain after _Make2D command. _Dim shows it is possible.
This is very important for us, because we need a good report.
Tags: CurveArrows, _Make2D, removed
Permalink Reply by Dale Fugier on February 20, 2013 at 8:53am Hi Michael,
I will report this as a bug with the Make2D command. In the mean time, create your curves with arrows on a different layer. Then, after you script the Make2D command, get all of the lines on your different layer and re-enable the curve arrows if needed.
Also, line in AutoCAD (DXF) do not support arrows, which is why you loose them when you export to DXF. I'll add an item on the wish list to "make something up" if this is the case when exporting.
Finally, contact SimLabs and let them know lines with arrows don't print to PDF.
Thanks,
-- Dale
Permalink Reply by Michael Berthold on February 21, 2013 at 1:26am Hello Dale,
thanks for your help.
SimLab is of course aleady informed.
I coded a workaround for _Make2D as you proposed. This in priciple is an acceptable solution, but one problem aleady came up. Lines that cross solids (in my example a sphere) are split into different lines by the _Make2D command. They suddenly get 2 (or more) vectors. I cannot handle this, because I create only one object.
So I would be glad if a solution will come in not too far future.
Thanks again
Michael
Option Explicit
'Script written by GLM
'Script version Donnerstag, 21. Februar 2013 09:03:43
Call Main()
Sub Main()
Dim strLayer, strObject, strLayerBase, i
On Error Resume Next
Rhino.EnableRedraw(False)
'picking an object solves localization problem in _Make2D (e.g. English/German language layer names different)
strObject = Rhino.GetObject("Pick any errorvector (green or red) in the _Make2D created drawing")
strLayerBase = Rhino.ObjectLayer(strObject)
i = instr(strLayerBase, "::GLM_")
If i > 0 Then
strLayerBase = mid(strLayerBase, 1, i + 1)
Else
strLayerBase = "2DZeichnung::Sichtbar::Linien::"
End If
'Reactivate all the arrows
strLayer = strLayerBase & "GLM_Point2Point::PP_InTol"
ActivateArrow strLayer
strLayer = strLayerBase & "GLM_Point2Point::PP_outOfTol"
ActivateArrow strLayer
'... and so on
Rhino.EnableRedraw(True)
End Sub
Private Sub ActivateArrow(strLay)
Dim arrObjects, Obj
arrObjects = Rhino.ObjectsByLayer(strLay, False)
If IsArray(arrObjects) Then
For Each Obj In arrObjects
If Rhino.IsCurve(Obj) Then
Rhino.CurveArrows Obj, 2
End If
Next
End If
End Sub
© 2013 Created by McNeel Admin.
