Autocad import really slow

Besides display color, what other “by layer” properties do you wish to transfer to the object itself? Linetypes, linewidths seem logical… Anything else?

–Mitch

Hi Helv,

I think it was one of your scripts that I ended up using to do what I described to the OP and it did just what I want and helped greatly with this sort of import of messy boated DWG's that I just need for reference without clogging up my working Rhino file. I don't think your script got properly registered in my R5. 

Looking in my download folder, I think it might be called ‘resetcolor’. Does that ring a bell. Here is the PY file from my download folder.

import Rhino

def main():
result, obrefs = Rhino.Input.RhinoGet.GetMultipleObjects(
‘Objects for colour reset ?’, True,
Rhino.DocObjects.ObjectType.AnyObject )
if result != Rhino.Commands.Result.Success:
return
Rhino.RhinoDoc.ActiveDoc.Objects.UnselectAll()

for obref in obrefs:
rob = obref.Object()
att = rob.Attributes
att.ColorSource = Rhino.DocObjects.ObjectColorSource.ColorFromLayer
Rhino.RhinoDoc.ActiveDoc.Objects.ModifyAttributes( rob, att, True )

print ‘Set colour from layer for %d objects’ % len( obrefs )
Rhino.RhinoDoc.ActiveDoc.Views.Redraw()

main()

No, that’s not one of my scripts… You can try the one below, though… You should get a dialog asking you to first select some objects and then for a layer to change to. If the objects have properties by layer (of the original layer), they will be transferred to be by object and thus stay with the object once it arrives on the new layer. Right now it’s the layer display color, linetype, print width and print color which transfer.

–Mitch

ChangeLayerRetainObjProperties.py (1.1 KB)

Hi Mitch,How do I set this up for use in Rhino. Sorry, I have not learned scripting yet.Thanks,David David & Kristen BuckleySV Sayonara(D) 843.735.9663
(K) 843.412.3188

Thanks Helvetosaur!

 I'll try your script as well.

Depends a bit on how you want to run the command. If you want to run it from a toolbar button, you can do the following:

Create a new toolbar button and open the button editor, In the Macro box, do the following:

! -_RunPythonScript (

paste the entire script in here

)

Check out this page for more info…

–Mitch

I am not sure if you still need it now. but i had the same problem of imported autocad and it runs really slow in rhino. what i did is that to turn on the block manager and delete all the referenced block as many as possible. and the file should be good to go.

Is that still the best solution here? I always have troubles of rhino being slow when I open/import an AutoCAD dwg :frowning: