I have tried to get some scripting done a few months back, but had no luck.
Thought I’d give it another go.
I require three scripts written, outlined below.
Please provide a quotation for these if you are interested.
If you know of anyone that can provide this service, please let me know.
Thanks,
Kristen
Block Leader:
We need a ‘leader’ dimension (see SCRIPTING EXAMPLE-BLOCK LEADER.jpg) that will display the block name (see SCRIPTING EXAMPLE-BLOCK LEADER2.jpg) of a block is shown in a detail of a layout
Must work for linked and embedded blocks
Will be a button on the toolbar, and typed command
Ideally, will get it’s properties from the current dimension style (not so important)
A standard block will exist within our standard titleblock, that will give the name and quantity of all blocks in the drawing (see SCRIPTING EXAMPLE-BLOCK LIST.jpg).
Linked blocks to show ‘top level’ only - not ‘total’ or ‘nested’
Non linked blocks to show ‘total’ only - not ‘top level’ or ‘nested’
Hide all blocks that start with the text “Title” and “HIDE”
(see SCRIPTING EXAMPLE-BLOCK LIST2.jpg)
A button or typed command will take selected geometries, an create linked blocks from them:
Process:
Block (user select geometries)
Specify origin (manual entry)
Specify name (manual entry)
Specify description (manual entry)
Note: the ‘name’ and ‘description’ text will be on the user’s clipboard from an automatic part number generator separated by a tab space.
It would be good if these could be pasted from the buffer automatically into the ‘name’ and ‘description’ boxes and ‘ok to confirm’. No big deal if it’s too messy.
Export file as .3dm using the block name as the file name.
The block description will become the ‘notes’ of the file, which
displays on our titleblock
Link block to exported file name through block manager.
This is very close to what I need.
The only thing lacking is that we do all of our documentation in the layout.
We place no annotations in the model space so that they aren’t seen in parent assemblies.
Is there any way to get this working in the layout?
RhinoScript does not have the ability to select object in a detail when a layout is active.
But with Rhino.Python and RhinoCommon (Rhino 5 only), you can.
See if this gets you any further:
import scriptcontext
import rhinoscriptsyntax as rs
import Rhino
def BlockLeader():
go = Rhino.Input.Custom.GetObject()
go.SetCommandPrompt("Select block instance to annotate")
go.GeometryFilter = Rhino.DocObjects.ObjectType.InstanceReference
go.EnablePreSelect(False, True)
go.InactiveDetailPickEnabled = True
rc = go.Get()
if rc == Rhino.Input.GetResult.Object:
prompt0 = "First point of leader"
prompt1 = "Next point of leader. Press Enter when done"
points = rs.GetPoints(True, True, prompt0, prompt1)
if points is not None:
objref = go.Object(0)
obj = objref.Object()
name = rs.BlockInstanceName(obj.Id)
rs.AddLeader(points, None, name)
if __name__ == "__main__":
BlockLeader() # Call the function defined above