Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by bejant »

Sometimes when I delete elements of a sketch I get the following error message:
20151113a-DuplicateConstraintNotAllowed.png
20151113a-DuplicateConstraintNotAllowed.png (9.11 KiB) Viewed 996 times
So I click the OK button to close the message and depending on the complexity of the sketch, FreeCAD (I suppose) continues to delete the other selected elements of my sketch until the error message might be displayed any number of times again. Each time have to click the OK button to close the error message before FreeCAD can continue deleting the other elements I had already selected.

Because I'm not adding anything (but instead am deleting) it seems to me that the error message should not appear, streamlining the workflow (as was the FreeCAD behavior from some time ago).

Comments?

OS: Ubuntu 14.04.3 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.16.5900 (Git)
Build type: None
Branch: master
Hash: be5e79601a58e3f70194797acb8dd2f807a5f3ae
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by jmaustpc »

bejant wrote:Comments?
Hi Bejant

I tried a few random things in a sketch and not been able to repeat that here. If you could you post a file and some specific instructions, I will try again.

Jim

OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5921 (Git)
Build type: Release
Branch: master
Hash: 821cd696c59bf640b6a7b6a00a127045f66bbf9c
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by bejant »

Here's an example:
20151114a.png
20151114a.png (1.81 KiB) Viewed 977 times
Edit Sketch, box select the rectangle on the right and everything inside it, and hit the Delete key to display the message. Click Ok, and for me it will pop up again repeatedly.
20151114a-DupConstNotAllowed.fcstd
(12.64 KiB) Downloaded 28 times
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by bejant »

Hmm... it seems there is an error in that sketch though. I can post more later.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by jmaustpc »

OK , now I get the same behaviour, after clicking OK enough times it does delete the selection but I thought I was going to have to crash FreeCAD for a while.

OS: Ubuntu 14.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5924 (Git)
Build type: Release
Branch: master
Hash: 629a89218d72d035fde6161eb6247b4bc0f0651d
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
DoubleHP
Posts: 15
Joined: Sun Mar 05, 2017 6:11 pm

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by DoubleHP »

I get the message very often while deleting only one element.

As a beginner, I was wondering if I had done a bad design, or broken my sketch; after reading this, I understand it's a bug in the app.

OS: "Gentoo Base System release 2.2"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Inappropriate "Duplicate Constraint Not Allowed" Error Message?

Post by bejant »

OS: Ubuntu 16.04.2 LTS
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.10476 (Git)
Build type: None
Branch: master
Hash: b6150097e9cf4d7b0f5ad71f2f8750f2e7aac0d9
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

Hi DoubleHP, I'm glad you replied because I had forgotten about this issue. To reconfirm the problem I opened the file that I uploaded Nov. 14, 2015 and Sketcher doesn't report any errors either before or after running the Macro_ForceRecompute. In the right rectangle I began deleting the Construction Geometry line segments one at a time beginning with the upper left segment, then proceeding downward, and moving over to the right after after one set of vertical Construction Geometry line segments have been deleted.

After individually deleting Construction Geometry I did a Box Select around the right rectangle and deleted that too.

By looking at the output in the Python Console the error messages happen when Constraints are renumbered:

Code: Select all

>>> App.ActiveDocument.Sketch.delGeometry(59)
>>> App.ActiveDocument.Sketch.renameConstraint(143, u'Constraint144')
>>> App.ActiveDocument.Sketch.renameConstraint(143, u'Constraint144')
>>> App.ActiveDocument.Sketch.renameConstraint(141, u'Constraint142')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(39)
>>> App.ActiveDocument.Sketch.renameConstraint(85, u'Constraint86')
>>> App.ActiveDocument.Sketch.renameConstraint(100, u'Constraint101')
>>> App.ActiveDocument.Sketch.renameConstraint(83, u'Constraint84')
>>> App.ActiveDocument.Sketch.renameConstraint(81, u'Constraint82')
>>> App.ActiveDocument.Sketch.renameConstraint(82, u'Constraint83')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(39)
>>> App.ActiveDocument.Sketch.renameConstraint(79, u'Constraint80')
>>> App.ActiveDocument.Sketch.renameConstraint(79, u'Constraint80')
>>> App.ActiveDocument.Sketch.renameConstraint(92, u'Constraint93')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(57)
>>> App.ActiveDocument.Sketch.renameConstraint(129, u'Constraint130')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(60)
>>> App.ActiveDocument.Sketch.renameConstraint(129, u'Constraint130')
>>> App.ActiveDocument.Sketch.renameConstraint(128, u'Constraint129')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(47)
>>> App.ActiveDocument.Sketch.renameConstraint(78, u'Constraint79')
>>> App.ActiveDocument.Sketch.renameConstraint(92, u'Constraint93')
>>> App.ActiveDocument.Sketch.renameConstraint(128, u'Constraint129')
>>> App.ActiveDocument.Sketch.renameConstraint(90, u'Constraint91')
>>> App.ActiveDocument.Sketch.renameConstraint(91, u'Constraint92')
>>> App.ActiveDocument.Sketch.renameConstraint(87, u'Constraint88')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(47)
>>> App.ActiveDocument.Sketch.renameConstraint(87, u'Constraint88')
>>> App.ActiveDocument.Sketch.renameConstraint(88, u'Constraint89')
>>> App.ActiveDocument.Sketch.renameConstraint(85, u'Constraint86')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(68)
>>> App.ActiveDocument.Sketch.renameConstraint(118, u'Constraint119')
>>> App.ActiveDocument.Sketch.renameConstraint(118, u'Constraint119')
>>> App.ActiveDocument.Sketch.renameConstraint(118, u'Constraint119')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(58)
>>> App.ActiveDocument.Sketch.renameConstraint(117, u'Constraint118')
>>> App.ActiveDocument.Sketch.renameConstraint(116, u'Constraint117')
>>> App.ActiveDocument.Sketch.renameConstraint(114, u'Constraint115')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delGeometry(58)
>>> App.ActiveDocument.Sketch.renameConstraint(113, u'Constraint114')
>>> App.ActiveDocument.Sketch.renameConstraint(112, u'Constraint113')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(85)
>>> App.ActiveDocument.Sketch.renameConstraint(112, u'Constraint113')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(84)
>>> App.ActiveDocument.Sketch.renameConstraint(111, u'Constraint112')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(83)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(82)
>>> App.ActiveDocument.Sketch.renameConstraint(111, u'Constraint112')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(81)
>>> App.ActiveDocument.Sketch.renameConstraint(110, u'Constraint111')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(80)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(79)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(78)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(77)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(76)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(75)
>>> App.ActiveDocument.Sketch.renameConstraint(110, u'Constraint111')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(74)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(73)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(72)
>>> App.ActiveDocument.Sketch.renameConstraint(109, u'Constraint110')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(71)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(70)
>>> App.ActiveDocument.Sketch.renameConstraint(109, u'Constraint110')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(69)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(68)
>>> App.ActiveDocument.Sketch.renameConstraint(86, u'Constraint87')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(67)
>>> App.ActiveDocument.Sketch.renameConstraint(86, u'Constraint87')
>>> App.ActiveDocument.Sketch.renameConstraint(107, u'Constraint108')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(66)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(65)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(64)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(63)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(62)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(61)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(60)
>>> App.ActiveDocument.Sketch.renameConstraint(85, u'Constraint86')
>>> App.ActiveDocument.Sketch.renameConstraint(107, u'Constraint108')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(59)
>>> App.ActiveDocument.Sketch.renameConstraint(84, u'Constraint85')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(58)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(57)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(56)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(55)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(54)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(53)
>>> App.ActiveDocument.Sketch.renameConstraint(84, u'Constraint85')
>>> App.ActiveDocument.Sketch.renameConstraint(105, u'Constraint106')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(52)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(51)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(50)
>>> App.ActiveDocument.Sketch.renameConstraint(83, u'Constraint84')
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(49)
>>> App.ActiveDocument.Sketch.delConstraintOnPoint(48)
>>> App.ActiveDocument.Sketch.delGeometry(66)
>>> App.ActiveDocument.Sketch.renameConstraint(103, u'Constraint104')
>>> App.ActiveDocument.Sketch.renameConstraint(104, u'Constraint105')
>>> App.ActiveDocument.Sketch.delGeometry(65)
>>> App.ActiveDocument.Sketch.renameConstraint(102, u'Constraint103')
>>> App.ActiveDocument.Sketch.renameConstraint(104, u'Constraint105')
>>> App.ActiveDocument.Sketch.delGeometry(64)
>>> App.ActiveDocument.Sketch.renameConstraint(101, u'Constraint102')
>>> App.ActiveDocument.Sketch.renameConstraint(103, u'Constraint104')
>>> App.ActiveDocument.Sketch.delGeometry(63)
>>> App.ActiveDocument.Sketch.renameConstraint(99, u'Constraint100')
>>> App.ActiveDocument.Sketch.delGeometry(62)
>>> App.ActiveDocument.Sketch.delGeometry(61)
>>> App.ActiveDocument.Sketch.renameConstraint(98, u'Constraint99')
>>> App.ActiveDocument.Sketch.delGeometry(60)
>>> App.ActiveDocument.Sketch.delGeometry(59)
>>> App.ActiveDocument.Sketch.renameConstraint(97, u'Constraint98')
>>> App.ActiveDocument.Sketch.delGeometry(58)
>>> App.ActiveDocument.Sketch.renameConstraint(97, u'Constraint98')
>>> App.ActiveDocument.Sketch.delGeometry(57)
>>> App.ActiveDocument.Sketch.renameConstraint(82, u'Constraint83')
>>> App.ActiveDocument.Sketch.delGeometry(56)
>>> App.ActiveDocument.Sketch.renameConstraint(81, u'Constraint82')
>>> App.ActiveDocument.Sketch.renameConstraint(82, u'Constraint83')
>>> App.ActiveDocument.Sketch.delGeometry(55)
>>> App.ActiveDocument.Sketch.renameConstraint(82, u'Constraint83')
>>> App.ActiveDocument.Sketch.renameConstraint(91, u'Constraint92')
>>> App.ActiveDocument.Sketch.renameConstraint(92, u'Constraint93')
>>> App.ActiveDocument.Sketch.delGeometry(54)
>>> App.ActiveDocument.Sketch.renameConstraint(79, u'Constraint80')
>>> App.ActiveDocument.Sketch.renameConstraint(80, u'Constraint81')
>>> App.ActiveDocument.Sketch.renameConstraint(89, u'Constraint90')
>>> App.ActiveDocument.Sketch.delGeometry(53)
>>> App.ActiveDocument.Sketch.delGeometry(52)
>>> App.ActiveDocument.Sketch.renameConstraint(78, u'Constraint79')
>>> App.ActiveDocument.Sketch.delGeometry(51)
>>> App.ActiveDocument.Sketch.renameConstraint(78, u'Constraint79')
>>> App.ActiveDocument.Sketch.renameConstraint(88, u'Constraint89')
>>> App.ActiveDocument.Sketch.delGeometry(50)
>>> App.ActiveDocument.Sketch.renameConstraint(75, u'Constraint76')
>>> App.ActiveDocument.Sketch.delGeometry(49)
>>> App.ActiveDocument.Sketch.delGeometry(48)
>>> App.ActiveDocument.Sketch.renameConstraint(84, u'Constraint85')
>>> App.ActiveDocument.Sketch.delGeometry(47)
>>> App.ActiveDocument.Sketch.renameConstraint(84, u'Constraint85')
>>> App.ActiveDocument.Sketch.delGeometry(46)
>>> App.ActiveDocument.Sketch.renameConstraint(83, u'Constraint84')
>>> App.ActiveDocument.Sketch.delGeometry(45)
>>> App.ActiveDocument.Sketch.renameConstraint(83, u'Constraint84')
>>> App.ActiveDocument.Sketch.delGeometry(44)
>>> App.ActiveDocument.Sketch.renameConstraint(82, u'Constraint83')
>>> App.ActiveDocument.Sketch.delGeometry(43)
>>> App.ActiveDocument.Sketch.renameConstraint(81, u'Constraint82')
>>> App.ActiveDocument.Sketch.delGeometry(42)
>>> App.ActiveDocument.Sketch.renameConstraint(78, u'Constraint79')
>>> App.ActiveDocument.Sketch.renameConstraint(79, u'Constraint80')
>>> App.ActiveDocument.Sketch.delGeometry(41)
>>> App.ActiveDocument.Sketch.delGeometry(40)
>>> App.ActiveDocument.Sketch.renameConstraint(76, u'Constraint77')
>>> App.ActiveDocument.Sketch.delGeometry(39)
>>> App.ActiveDocument.Sketch.renameConstraint(77, u'Constraint78')
>>> App.ActiveDocument.Sketch.delGeometry(38)
>>> App.ActiveDocument.Sketch.renameConstraint(76, u'Constraint77')
>>> App.ActiveDocument.Sketch.renameConstraint(77, u'Constraint78')
>>> App.ActiveDocument.Sketch.delGeometry(37)
>>> App.ActiveDocument.Sketch.renameConstraint(75, u'Constraint76')
>>> App.ActiveDocument.Sketch.delGeometry(36)
>>> App.ActiveDocument.Sketch.renameConstraint(73, u'Constraint74')
>>> App.getDocument("_0151114a_DupConstNotAllowed").recompute()
In this use case I think that deleting the Constraints should happen without error messages.
Post Reply