Blocs and layers

Use this forum to ask questions about how to do things in the QCAD Community Edition.

Moderator: andrew

Blocs and layers

Postby Bobsky » Sun Jun 29, 2008 3:44 pm

Hi !
My problem is the following :

I've created some blocs representing objects. When creating these blocs, I've filled the "layer" fields for each geometric element of the bloc (for example, I choosed the layer named "A").
When editing the global plan, I put an instance of this bloc in the layer "A".
How can I insert an instance of my bloc in another layer ? When I try inserting in a "B" layer, the behavior after the operation is the following :
- when I mask the "B" layer, the second instance becomes unvisible and the first one is still visible (it's ok for me)
- when I mask the "A" layer, the two instances become unvisible ... And it's not the behavior I'm waiting for :( (I would like that only the first instance became unvisible).

So I think there is something I did not understood about blocs and layers ... Can somebody help me ?

Thanks a lot !
Bobsky
Newbie Member
 
Posts: 3
Joined: Sun Jun 29, 2008 3:29 pm

Postby andrew » Sun Jun 29, 2008 3:54 pm

Maybe the FAQ helps:

http://www.ribbonsoft.com/qcad_doc_faq.html#21

-> "21. My block / insert / entities within a block appear to be on more than one layer. "
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

Postby Bobsky » Sun Jun 29, 2008 4:05 pm

Thanks for your so fast answer !
Mmmmm .... Ok, yes, It's exactly my "problem" that is described in the FAQ :( ...
But is it possible to have another behavior ?
I think : If I create a third ("C") layer and put all the created blocs in it, and if after doing that every instances of blocs are created in "A" or "B", could I have the behavior I'm waiting for ? (I've created a lot of blocs, like a pig, before discovering this problem, so now I'm trying to think before changing all blocs ;o) ).
Bobsky
Newbie Member
 
Posts: 3
Joined: Sun Jun 29, 2008 3:29 pm

Postby Bobsky » Sun Jun 29, 2008 4:12 pm

Ok, after trying the "three layers solution" on just one simple bloc, it seems to do what I want ...
Sorry for this wrong question :(
Bobsky
Newbie Member
 
Posts: 3
Joined: Sun Jun 29, 2008 3:29 pm

blocks and layer "0"

Postby rwells » Tue Jul 22, 2008 8:28 pm

It seems that not only is a block in its own layer and layer "0" but that its attributes (color, etc) are changed by editing "0" not the layer where the block was inserted. How then could blocks on different layers be assigned different colors or blocks on one layer be on and on another off? In AutoCad (2000) this is definitely different, blocks are managed only on the layer where they are inserted.
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Re: blocks and layer "0"

Postby andrew » Tue Jul 22, 2008 8:40 pm

rwells wrote:It seems that not only is a block in its own layer and layer "0" but that its attributes (color, etc) are changed by editing "0" not the layer where the block was inserted. How then could blocks on different layers be assigned different colors or blocks on one layer be on and on another off? In AutoCad (2000) this is definitely different, blocks are managed only on the layer where they are inserted.


Block inserts are on exactly one layer. Each entity inside a block definition is also on exactly one layer.

If you want to assign entity attributes based on the layer a block insert is on, you can do this by changing those attributes of those entities inside the block definition to "ByBlock". When you insert a block, make sure that all attributes are set to "ByLayer" (the default).

Example:
- A line inside a block has the color attribute set to "ByBlock".
- Layer "Red" has its color set to red.
- Layer "Green" has its color set to green.
- If the block is inserted into the drawing on layer "Red", the line in the block insert will be red.
- If the block is inserted into the drawing on layer "Green", the line in the block insert will be green.

Please let me know if this does not make sense to you or you still think that autocad handles this differently.
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

blocks and layer "0"

Postby rwells » Wed Jul 23, 2008 7:12 pm

Thanks for your reply to my post of yesterday.
First, a little background:
We collect data that consists of among other things the position of a moving ship. We plot these data using AutoCad. We do this using a program that I wrote that converts elements of the ship's track to a DXF file consisting of three layers. The first is a polyline connecting the successive ship positions. The second is text entities that time tag some subset of the positions. The third is block insertions at each ship position. The blocks are simple: box, triangle, asterisk, circle, etc. and are defined in a BLOCKS section in the DXF file. This has been in use here for over twelve years. Historically my DXF files have been binary because this kept them to about half the size of their ascii equivalents and they loaded in about one half the time. This was important because back then PC's were much slower and our drawings routinely had many thousands (even a million) such elements. This consideration is not so important now. I recently bought QCad to provide a Linux option for plotting these data. Here I learned that QCad does not apparently support binary DXF files. No problem, I just wrote the DXF routines to create ascii rather than binary files. I am explaining this because obviously if I am writing the code to make the DXF file I might be making a misake and if so perhaps you can provide some guidance or hints? The resulting ascii DXF file is loaded into AutoCad with no complaints. My three layers are there populated with the expected data. I can change their colors, turn them on and off, etc as expected. There is no evidence of anything on layer "0". I can turn that on & off without affecting the appearance of drawing on the screen at all. Next I load the DXF in QCad. No complaints here either. The polyline & text layers can be treated the same as in AutoCad. But not the blocks. I can turn them off by turning either layer "0" or their own layer, etr_PLUS, off. To turn them on both layer "0" and etr_PLUS must be on. To change the color of the entire layer the color of layer "0" must be changed. Changing the color etr_PLUS has no effect. Selecting a single block and attempting to change its attributes has no effect. This does work as expected on the text layer entities. My DXF files are identified (by AutoCad when loading them) as consistent with AutoCad Release 12. Perhaps QCad requires a more recent release?

So yes I do think that AutoCad is handling these data differently.
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Postby andrew » Wed Jul 23, 2008 7:17 pm

Yes, this sounds now a lot more like a DXF problem. If you send us a sample file we can look into it within a couple of weeks time.
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

blocks and layer "0"

Postby rwells » Wed Jul 23, 2008 8:04 pm

I'll make a small one. Where do I send it?
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Postby andrew » Thu Jul 24, 2008 10:07 am

Please sent it to info [at] ribbonsoft [dot] com
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

Postby andrew » Tue Aug 12, 2008 2:04 pm

Roger, I think you didn't receive my mail about this from 07/24/2008, so here's my answer again:

QCad does not default the color of entities to "ByBlock" like AutoCAD does.

I recommend to set the color of all entities inside blocks to "ByBlock" explicitly (code 62, value 0). E.g.:

Code: Select all
...
  0
LINE
  8
0
 62              <-- color code
0                <-- color value (ByBlock)
 10
-0.353553
...
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

still not consistent with AutoCad

Postby rwells » Tue Aug 12, 2008 5:35 pm

Does it bother you that QCad will not deal with an AutoCad generated DXF file properly.
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Another block & layer anomaly

Postby rwells » Mon Sep 08, 2008 11:50 pm

I have two drawings. I intend to import the second into the first by copying the contents with a reference and pasting into the first drawing. The second drawing has three layers in addition to layer "0". One layer ("lines") consists of polylines, the second ("blocs") consists entirely of blocks defined in its drawing and inserted into the "blocs" layer, and the third layer ("times") consists entirely of text entities. None of these layers exist in the first drawing. I can select everything, assign a reference point at 0,0 and copy. When I go back to the first drawing and paste the "times" and "lines" layers are created as expected but the "blocs" layer is not. However the block entities that were in the "blocs" layer in the second drawing are placed in layer "0" in the first. Given past discussion in this thread this may not be surprising but it makes it difficult to manipulate them since all of the blocks inserted already in the first drawing are there as well.
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Another block & layer anomaly

Postby rwells » Fri Sep 19, 2008 7:18 pm

Andrew,

Have you any thoughts on my Sep 08 post on this subject?
thanks,
roger

BTW QCad is doing the job I need it for nicely (except for this little wrinkle)
rwells
Junior Member
 
Posts: 12
Joined: Wed Jul 16, 2008 9:49 pm

Postby andrew » Fri Sep 19, 2008 7:39 pm

Not really.. it could be a bug. If you paste a selection, all required layer should be created. You might want to try creating the required layers first instead.

Can it be that none of the entities of your selection is directly on layer 'blocs' but that only the entities inside the blocks are on that layer? In that case you could try to copy at least one entity that is directly on layer 'blocs' with the rest to make sure that the layer is also copied.
User avatar
andrew
Site Admin
 
Posts: 2590
Joined: Fri Mar 30, 2007 6:07 am

Next

Return to QCAD Community 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron