• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

declare layers

  • Thread starter Thread starter Gio_S
  • Start date Start date

Gio_S

Guest
Hello, everyone. I develop autolisp in intelligent environment.
However, I try to do this with a portability even on autocad, and this theoretically should be assured.
Now, in my various converters, I check the color in files of various kinds using, if at the origin I convert from dxf, the layer name of the entity, if appropriately arranged with a name that aims to represent a color. or possibly use its layer color or ultimately the color of the entity (cod 62 classic).
My question, however, is simple, because I think I had the problem with the autocad.
if I generate a dxf file, and in the layers section I only have 0, but then in the entity section I also use other layer names (not declared in its appropriate section), autocad creates this layer or gives error reading the dxf?
Of course, this "simplified" method, without prior declaration of all the later found layers, does not allow me to assign a color to the layer (cod 62) that appears suddenly in the entity, but I do not care.
I would be grateful if someone knows, or at the head limit on autocad with these steps, which intellicad allows me without errors.
create a dxf with a triangle (just to exemplify an entity)
edit by hand the file by replacing after code 8 (name layer) of the entity a text type "nuovolayer" to the 0 that will be found.
save the file and reopen with autocad to see if "protes" or even ignores and throws the triangle on layer 0.
Many thanks for patience, triple thanks if someone enlightens me!
Thursday
 
Thank you so much, this allows me not to memorize twice the dxf file that I am creating in order to create a prior list of the layers used by the entities that I went to locate, as in the lisp of intellicad!
 
I basically working I transmit and retransmit inside and out stl files and povray in the cad, it is true that they are conversions for personal use, but I prefer to avoid bugs when I pass the converters to someone! thanks again!
 
I did the procedure required, autocad works.
this procedure only changes the active layer to the opening of the file that becomes what you write after code 8 (name layer) . All entities are always on the plans in which they were created.
Hi.
 
Thanks, you also give me confirmation that writing a dxf is enough to enter the name of the layers by associating it from time to time to the entity that uses it, because he thinks about it, uploading the file, to fill correctmte the table that contains all the layers. It is a nice comfort, because otherwise, writing my dxf I should already know and bring back in table all the names of layers that I will meet in entities. then pursuing the search for entities twice.
 
for me it is important to understand this particularity because after so many years I use and improve my converter I realized that I have to rewrite it from head and I am doing it.
As I needed formats and specifications over the years, I added the relevant input and output procedures. Now, a little late but it happens, I saw that it was becoming a redundant mess to follow and improve, and where it is therefore easy to slip some mistakes, I discovered hot water. when I load a file to be converted, regardless of the saves I use, I already convert it into a "inside" format, in memory, as much as possible slender, manageable and compact. having to work later only on that every improvement or addition becomes easier to implement.
in practice it is only pov ray that in case then it will ask me to group the entities by color, if I chose to generate a compact mesh-based output that therefore wants, once and for all, the mesh color statement.
all other conversions become in reality data formatters, with the only stl for which via I will also calculate the normal request on the floor (although many smart programs ignore it and throw us a triplet x.y.z of zeros:)
In short, all this is useful to me but also fun.
 
a small warning, in case someone wrote dxf
the layer, as mentioned above, is not mandatory to declare it in advance in its section, because it will think of the first occurrence of the face that is declared under this layer, to make it create.
this later I found it written, beyond my experience, even on a manual.

But be careful, of this layer orphan face declared in the dxf you can not create color with code 256 (which means bylayer).
In this case, I work with intellicad, but I think autocad does the same, the cad does not transpose code 256 as such, but it transposes a code 0. that does not mean bylayer, but byblock, although the block does not exist.
At this point, even changing the color of the whole layer, the face will refuse to take it, I took two hours to understand what the hell was going on.
to solve, writing a dxf without layer header, in the face, or declares a precise face color, as obtained from the color table, or should be avoided altogether code 62, jumping it. which is not obligatory anyway. in this way you will have the desired bylayer (256).
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top