Text Editor for 3dm Files


#1

Rhino v4

Is it possible to use some type of text editor to manually modify layer information in a 3dm file? If so, what editor works with 3dm files?

Thanks


(Dale Fugier) #2

Sorry, no. 3DM files are written in a binary-formatted file. Thus, they can not be edited by Notepad or any other text editor.

We do, though, provide a free toolkit that allows developer to write applications that can read and write 3DM files. Thus, it is possible for somebody to write the tool you describe.


#3

Thanks Dale

I have a need for 50 layers with each having 40 identical sub-layers. Wanting to create a template file with this structure. Doing so with the Layer tool in Rhino v4 will take many, many hours to create.

Is there a easier way do do this?


(Dale Fugier) #4

You could (or somebody could) easily write a script to add the layer structure. Can you provide more details?


(Dale Fugier) #5

You can also right-click on a laye and pick “Duplicate Layer” and it will duplicate the selected layer and any children. Then, you’d just have to rename the 50 root-level layers…


#6

In Rhino v4 there is no Duplicate Layer available when I right click on a layer.

The DupLayer command doesn’t duplicate the layer sub-structure.

Is there a Duplicate Layer script for Rhino v4


#7

Do this in V5:

Create your one top level layer, and its 40 sublayers (you only have to do this once).
Once you have that done, collapse the sublayers, then right click on the top level layer and choose “Duplicate Layer”. A dialog will come up asking if you want to duplicate sublayers, answer “Yes to all”.

You will now have 2 sets. Select both top level layers and repeat the above procedure. You will now have 4 sets. Select all 4 top level layers and duplicate as above. You will have 8 sets… Then 16, 32, 64. Delete the last 14 sets…

Now all you have to do is rename the top level layers… Then save the file as V4…

–Mitch


#8

Thanks Mitch

I don’t have v5 or access to a machine that has v5.


#9

It’s a free download and runs for 90 days without restrictions…

http://www.rhino3d.com/download

–Mitch


(Dale Fugier) #10

Again, its possible to write a script to do this - even in V4. I just need some details on the layer structure you are trying to build.


#11

Maybe the following script from my library will help…

DupLayersAndSublayers.rvb (2.1 KB)

It’s certainly possible to write a custom script that will read two text files - one for the main layer list and one for the sublayer list - and create the layers, but I don’t have time right now to create such a script which will probably not be used very often…

–Mitch


#12

Original layer is named A Layer, sub-layers named A1, A2, A3, etc.

Duplicate layer to be named:

Layer B
B1
B3
B3
etc

Layer C
C1
C3
C3
etc

Layer D
D1
D3
D3
etc

etc

A Layer.3dm (37.3 KB)


#13

OK, that’s a bit different than your original statement that all the sublayer sets are identical… In fact, now that I think about it, I think having identically named sublayers in V4 was not allowed… So what you want is only possible through scripting… What happens after top level layer 26? Layer AA, Layer BB…?

–Mitch


#14

You are correct. In v4 the sub layers from one layer can’t have the same name as any other layer or sub-layer. Thus the A, B C, etc. prefix.

Yes after Z Layer comes AA, BB, CC, etc


#15

OK, you can try this one. I didn’t have time to generalize it for any number of layers/sublayers (I can do that later), but it should do what you asked for (52 top layers A-ZZ, 40 each numbered sublayers). It runs pretty slowly in V4, but it works here.

–Mitch

CreateLayerSubLayerSets.rvb (893 Bytes)


#16

The script creates NEW layers, but doesn’t COPY the existing Layer A with it’s sub-layers.

The sub-layers are all default color black.


#17

Once you get it configured, don’t forget to use the command File → Save As Template…

Then, you’ll have that empty file & layer configuration ready anytime a new project is started.


#18

Well, if you only give us a part of what you need every time, how do you expect it to be right? All I got was this:

There was nothing ever said about objects on the layers needing to be duplicated. Nor was layer color mentioned.

–Mitch


#19

Mitch

I’m sorry that you misunderstood what I need.

In your 1st post to this thread you were talking about DUPLICATING a layer and all it’s sub-layers. You even provided a duplicate layer script in a following thread.

In my 5th post I included a file with a layer with the sub-layers needing DUPLICATED. Most of this thread has been about duplicating a layer and all it’s sub-layer. 50 layers with 40 sub-layers is 1950 sub-layers that would need to be manually set up. The whole purpose of this thread is to DUPLICATE one master layer with it’s 40 sub-layers, each sub-layer of a different color like in the sample file I provided.

Where we may have went wrong may have been the way I said the 40 sub-layers were identical. I didn’t mean the 40 were identical to each other, I meant the sub-layers of layer A would be identical to the sub-layers of layer B would be identical to the sub-layers of layer C, etc.


#20

OK, sorry, I didn’t see the attachment above. So, are there going to be objects on the layers in the template or is it just going to be “blank”? I’ll see what I can cook up tomorrow.

–Mitch