Snap problem, entities inside block

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
mariosboarina
Junior Member
Posts: 19
Joined: Thu Nov 29, 2012 4:28 pm

Snap problem, entities inside block

Post by mariosboarina » Fri Feb 01, 2013 7:42 pm

Hi
I have a problem with snap on entities inside a block reference. It seems it cannot sense centers, midpoints etc of geometry inside references.
If I cut+paste the blockrefs in a new document it works without problem.
In attachment, the incriminated drawing.
I don't have the problem with other drawing, but I can't say what's the difference between them.
I run on QCad 3.0 on Windows 7 (the same with 3.0.8 ).
Attachments
test snap.dxf
(52.11 KiB) Downloaded 775 times

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: Snap problem, entities inside block

Post by J-J » Fri Feb 01, 2013 10:02 pm

Hello,
I stumbled on the same problem. I don't recall noticing that with the previous version 2.2.2.0
JJ

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Snap problem, entities inside block

Post by Clive » Sat Feb 02, 2013 11:55 am

mariosboarina wrote:In attachment, the incriminated drawing.
Is this an original drawing by you in QCAD or is it originally from another source?

mariosboarina
Junior Member
Posts: 19
Joined: Thu Nov 29, 2012 4:28 pm

Re: Snap problem, entities inside block

Post by mariosboarina » Mon Feb 04, 2013 9:21 am

It is the export of an annotation view froma a 3D CAD.
(I verified arcs to be arcs and Z coordinates to be 0)

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: Snap problem, entities inside block

Post by J-J » Mon Feb 04, 2013 7:44 pm

My observation was with one of my own drawings. This seems to happen mostly with ref points on circles...

mariosboarina
Junior Member
Posts: 19
Joined: Thu Nov 29, 2012 4:28 pm

Re: Snap problem, entities inside block

Post by mariosboarina » Fri Feb 08, 2013 3:38 pm

Ok, it seems reasonable, but in some way the most of drawings don't have this problem.
For example, see attached drawing, in which snaps works perfectly from outside blockRefs:
test snap ok.dxf
(44.15 KiB) Downloaded 741 times
So, there is somehow a way to access snap points in subentities without exploding blockRefs.
Maybe some script lines that regenerate entities representation or other internal entities data (hoping it was a problem of scene/view representation, I've tried with rebuildSpatialIndex() without success...)
It would be nice to work out a solution, since exploding a block in order to snap its entities it's a big work related to the simple purpose of selecting a point (it involves modifing the drawing strucutre, which has to be restored in a second moment).

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Snap problem, entities inside block

Post by Clive » Fri Feb 08, 2013 4:13 pm

J-J wrote:My observation was with one of my own drawings. This seems to happen mostly with ref points on circles...

My understanding is that when a block is created a block 'reference point' is created at this time and becomes the main reference point for the block!

When a block is created including circles/arcs all the entities are 'grouped' together and 'locked' including the references for the arcs, however snapping to the endpoints/mid points of line entities should still be available, but in order to snap to the reference points of Arcs and Circles - the block will need to be exploded first to 'un-group' everything and thereby releasing the reference points again for the arcs and circles.

User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Snap problem, entities inside block

Post by Clive » Fri Feb 08, 2013 4:18 pm

mariosboarina wrote:Ok, it seems reasonable, but in some way the most of drawings don't have this problem.
For example, see attached drawing, in which snaps works perfectly from outside blockRefs:
To my understanding :wink: your example shows clearly what I was explaining in my response to J-J - that you cannot snap to the ref points of arcs/circles in a block, but you should be able to snap to end points etc... to line entities.

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: Snap problem, entities inside block

Post by J-J » Sat Feb 09, 2013 10:22 pm

Hi Clive,
That's right, all other entities are recognized except circles and arcs. I checked this behavior in 2.2.2.0, same thing.

mariosboarina
Junior Member
Posts: 19
Joined: Thu Nov 29, 2012 4:28 pm

Re: Snap problem, entities inside block

Post by mariosboarina » Mon Feb 11, 2013 12:54 pm

Sorry, perhaps one thing I didn't mention :oops: : I'm not using Auto snap mode, but instead I activate Center mode before selecting.
In fact with Autosnap I can replicate J-J behaviour; instead, using Center snap, I have some drawings which snap to centers and some which doesn't.
With Center snap active, in the last example file I've no problem to snap to circles' center from outside blocks; all entities are recognized to my QCad with this drawing. This does not happen with the first drawing, in which I can't.
So I'm speaking of selecting centers when Qcad is in SnapCenter mode. It's not a bad matter in fact if, with Auto snap mode, block reference points and line ends (rightly) have precedence over (and therefore do mask) centers.

So, in short, my initial problem still remains:
I have 2 drawings: in the 1st I can't snap centers inside blocks (in Center snap mode) whereas in the 2nd drawing I can do it; the 2 drawings have different behaviour and I can't guess which is the difference between them. If I cut+paste the problematic block in a new drawing the problem disappears: so it's a problem specific to the drawing (which in fact comes from outside cad).
As a user it's not a big deal (keyboard BD, slect block and then snap to center, then keyboard EM: and I'm still into my main command with my center selected!).

Sorry for taking it long: I really know it's not a big problem for a designer, but I'm developing a mechanism simulation application in which selections will be 80% arc centers inside blocks and I solving this problem would dramaticaly speed up the user interaction. Also I feel (having drawings without this problem) that likely there is a solution.

mariosboarina
Junior Member
Posts: 19
Joined: Thu Nov 29, 2012 4:28 pm

Re: Snap problem, entities inside block [SOLVED (workaround)

Post by mariosboarina » Sat Feb 16, 2013 2:13 pm

Finally, I almost found out what's the matter!
Sure I found out a difference between the 2 drawings I attached: origin of blocks in the problematic drawing is different from (0,0) and I think this is not somehow contemplated by Snap algorithm (or perhaps it makes some noise over it or over some spatial indexing, I don't know).
Anyway: resetting origin of block to (0,0) do actually solve my original snap problem.
I posted, in developers section, a workaround to reset origin of all blocks in the drawing (viewtopic.php?f=30&t=2332): applied to a drawing it makes snaps work.

Post Reply

Return to “QCAD Troubleshooting and Problems”