request for script to create layer from object name.

hi,

would love to have a script to create a layer from object name.
would be usefull for scenes linked to 3dsmax from revit.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

This should work with selection of objects:

(	
	if selection.count != 0 do
	(
		for o in selection do
		(
			objName = o.name
			if (objLayer = LayerManager.getLayerFromName objName) == undefined then
			(
				objLayer = Layermanager.newLayerFromName objName
				--	uncomment the line below to add object to the layer
				objLayer.addNode o
			)
			else
			(
				--	uncomment the line below to add object to the layer
				objLayer.addNode o
			)
		)
	)
)
Realestatements's picture

Yes, it works perfect now!

Yes, it works perfect now! Thanks for fixing the script!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.