Cannot Copy/Paste Library Objects

If you are having problems with QCAD, post here. Please report bugs through our Bug Tracker instead.

Always attach your original DXF or DWG file and mentions your QCAD version and the platform you are on.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
stecoop1
Newbie Member
Posts: 8
Joined: Sun Sep 20, 2020 5:36 pm

Cannot Copy/Paste Library Objects

Post by stecoop1 » Tue Nov 23, 2021 4:12 pm

I am using QCad Pro, Version 3.26.4.0 (3.26.4) Rev 0bb4334, QT Version 5.13.2

I'm on Windows 10 64-bit Pro, fully up to date.

I am unable to copy library objects from one drawing to another, with or without reference.

In the attached Test.dxf file follow these steps:

Open QCad; leave the "untitled.dxf" open.
Open "Test.dxf"
Navigate to the layer "Terminal Block Labels & Jumpers/9 - Single Level Block Labels/Terminal Blocks". Make that the active layer.
Right click and choose "Select Layer Entities (Y+)".
Type "RC" and click on 0,0 as the reference point.
Go upto the tab bar and open the "untitled.dxf" page.
Type "PS" and move the pointer to 0,0.
Make sure all the paste options are at default - no rotation, scale 1, no boxes checked (or check some of them, it doesn't matter).
Nothing appears except the bounding box; click on the 0,0 and all that happens is the layer list shows the added layers (or doesn't if "To Current Layer" was checked).
The terminal blocks never show up! e_confused

I have tried resetting QCad configuration by deleting the "QCAD3.ini" and "library_3_0_0_9.db" files as suggested in the "Resetting QCad" document.
(I also tried deleting just the "QCAD3.ini" file.)
The result(s) was that ALL library objects in ALL of my drawings DISAPPEARED! e_surprised (I have nearly a hundred drawings).

Fortunately, I had saved the original configuration files and when I restored them, all my library objects returned.

I should point out that if I paste to another layer within the source drawing, it works okay; it's just pasting to another drawing that is not working.

Another issue is that I cannot "Explode" a library object in a drawing; if I try, the object just disappears completely.

All of this use to work, but now it doesn't, and it is very annoying. I am working on many drawings that are very similar to each other and it would be very helpful to be able to copy groups of library objects from one drawing to another.

Any suggestions on how to fix this WITHOUT corrupting all my existing drawings?
Attachments
Test.dxf
(794.04 KiB) Downloaded 265 times

User avatar
ryancousins
Premier Member
Posts: 367
Joined: Thu Mar 19, 2020 3:47 am
Location: Michigan, USA

Re: Cannot Copy/Paste Library Objects

Post by ryancousins » Tue Nov 23, 2021 4:42 pm

When I follow your workflow, I'm able to paste the terminal blocks into the new blank drawing file and they show up for me. Just to make sure we're on the same layer, when I select everything in the "Terminal Block Labels & Jumpers/9 - Single Level Block Labels/Terminal Blocks" layer, I end up with 45 block references selected. Is that correct?

User avatar
andrew
Site Admin
Posts: 9059
Joined: Fri Mar 30, 2007 6:07 am

Re: Cannot Copy/Paste Library Objects

Post by andrew » Tue Nov 23, 2021 5:02 pm

Most of your layers are switched off (invisible) and many are locked. Please make sure the layers involved in this transaction are unlocked and visible. Note that the entities inside blocks are also on layers. "block_6" for example contains entities on layer "0" which is both locked and invisible in your drawing.

QCAD does not select entities on invisible or locked layers to protect you from modifying something you can't even see.

If in doubt, make all layers visible and unlock them before you copy:
Layer > Unlock all layers
Layer > Show all layers
I have tried resetting QCad configuration by deleting the "QCAD3.ini" and "library_3_0_0_9.db" files as suggested in the "Resetting QCad" document.
(I also tried deleting just the "QCAD3.ini" file.)
The result(s) was that ALL library objects in ALL of my drawings DISAPPEARED! e_surprised (I have nearly a hundred drawings).
No. Your library items are regular DXF files on disk, they don't just disappear unless you delete them with a file manager of your operating system.

What happens if you delete the library database (library_3_0_0_9.db) is that the library browser does not show anything anymore as all the preview icons and references to your library items are no longer in the database. You can simply sync (update) the database using the sync button at the bottom right to make them reappear again:
Screenshot 2021-11-23 at 16.56.13.png
Screenshot 2021-11-23 at 16.56.13.png (86.2 KiB) Viewed 4783 times
Another issue is that I cannot "Explode" a library object in a drawing; if I try, the object just disappears completely.
Please post one question per topic, thanks. This might or might not be the same issue (working with locked and invisible layers).

User avatar
ryancousins
Premier Member
Posts: 367
Joined: Thu Mar 19, 2020 3:47 am
Location: Michigan, USA

Re: Cannot Copy/Paste Library Objects

Post by ryancousins » Tue Nov 23, 2021 5:10 pm

Andrew brought up really important points about hidden and locked layers that I forgot to mention. I did have to unlock and unhide some layers to make this work! I assumed you just locked them before attaching the file because had you had them locked or hidden while trying to copy, it wouldn't show that anything was selected, and I assumed at that point you'd notice nothing was copied before you tried to paste into the other file. Also, you mentioned that you were able to paste those items into the same drawing, which would mean at some point you had those items unlocked and unhidden?
Last edited by ryancousins on Tue Nov 23, 2021 5:14 pm, edited 1 time in total.

stecoop1
Newbie Member
Posts: 8
Joined: Sun Sep 20, 2020 5:36 pm

Re: Cannot Copy/Paste Library Objects

Post by stecoop1 » Tue Nov 23, 2021 5:14 pm

I am finding that if layers "0" and "Defpoints" are locked at the time I do the Copy/Copy With Reference, the paste into another drawing will not work.
Playing with that, I find that both those layers must be unlocked BEFORE I activate the layer I want to copy from, otherwise the paste will not work.

Note: I've been keeping those layers locked so I don't accidently put something on those layers, as had happened frequently when I first started using QCad.

The Visibility of OTHER layers, seems to have no effect on Copy/Paste, as long as the source layer AND target layer are visible.

This is a weird problem, but I think I have solved it.

stecoop1
Newbie Member
Posts: 8
Joined: Sun Sep 20, 2020 5:36 pm

Re: Cannot Copy/Paste Library Objects

Post by stecoop1 » Tue Nov 23, 2021 5:17 pm

andrew wrote:
Tue Nov 23, 2021 5:02 pm

No. Your library items are regular DXF files on disk, they don't just disappear unless you delete them with a file manager of your operating system.
I didn't mean that the library files disappeared, only the library objects within drawings that used them disappeared.

User avatar
ryancousins
Premier Member
Posts: 367
Joined: Thu Mar 19, 2020 3:47 am
Location: Michigan, USA

Re: Cannot Copy/Paste Library Objects

Post by ryancousins » Tue Nov 23, 2021 5:24 pm

stecoop1 wrote:
Tue Nov 23, 2021 5:14 pm
I am finding that if layers "0" and "Defpoints" are locked at the time I do the Copy/Copy With Reference, the paste into another drawing will not work.
It appears that while your block references reside in the terminal block layers, your original block definition resides in the "0" layer. This would cause your original issue since QCAD is trying to copy the original block definition into the new file along with all of the reference copies of it in your model space. Since you had the "0" layer locked, QCAD didn't select the original block definition so when you tried to paste your block references into the new drawing, there was no original definition geometry for it to be based upon in the new drawing. Does that make sense? You'll either need to unlock the "0" layer, or move your block definitions to a different layer that remains unlocked.

stecoop1
Newbie Member
Posts: 8
Joined: Sun Sep 20, 2020 5:36 pm

Re: Cannot Copy/Paste Library Objects

Post by stecoop1 » Tue Nov 23, 2021 5:30 pm

andrew wrote:
Tue Nov 23, 2021 5:02 pm
Another issue is that I cannot "Explode" a library object in a drawing; if I try, the object just disappears completely.
Please post one question per topic, thanks. This might or might not be the same issue (working with locked and invisible layers).
As it turns out, it is related. If layers "0" and "Defpoints" are invisible at the time the object is selected (as I usually have them), "Explode" makes it disappear; It won't be found on either the "0" or "Defpoints" layer; only "Undo - Explode" brings it back.

Again, very weird.

User avatar
ryancousins
Premier Member
Posts: 367
Joined: Thu Mar 19, 2020 3:47 am
Location: Michigan, USA

Re: Cannot Copy/Paste Library Objects

Post by ryancousins » Tue Nov 23, 2021 5:41 pm

stecoop1 wrote:
Tue Nov 23, 2021 5:30 pm


As it turns out, it is related. If layers "0" and "Defpoints" are invisible at the time the object is selected (as I usually have them), "Explode" makes it disappear; It won't be found on either the "0" or "Defpoints" layer; only "Undo - Explode" brings it back.

Again, very weird.
Yes, this is a similar situation. When you go to explode that block reference, the operation fails (there will be an error message in the command line) if the layer in which the original block definition resides in is locked. (I suspect that QCAD can't make a new, independent exploded instance of that block's geometry because it isn't able to access the original definition geometry since it is in a locked layer.) Both issues are a function of the relationship between an original block and the subsequent references to it and how that relationship is affected if the definition and the reference(s) live in different layers.

stecoop1
Newbie Member
Posts: 8
Joined: Sun Sep 20, 2020 5:36 pm

Re: Cannot Copy/Paste Library Objects

Post by stecoop1 » Tue Nov 23, 2021 6:41 pm

Yeah, I think the bottom line here is "Don't lock or make invisible layers 0 and Defpoints; just leave them alone."

User avatar
ryancousins
Premier Member
Posts: 367
Joined: Thu Mar 19, 2020 3:47 am
Location: Michigan, USA

Re: Cannot Copy/Paste Library Objects

Post by ryancousins » Tue Nov 23, 2021 6:46 pm

stecoop1 wrote:
Tue Nov 23, 2021 6:41 pm
Yeah, I think the bottom line here is "Don't lock or make invisible layers 0 and Defpoints; just leave them alone."
That is one solution. Personally, I never draw anything in the "0" or "Defpoints" layer. And my block references almost always reside in the same layer as their definition. But I agree the easiest option for your particular drawing is to just keep those layers visible and unlocked. :lol:

Post Reply

Return to “QCAD Troubleshooting and Problems”