TheSwamp

Code Red => ARX Programming => Topic started by: It's Alive! on June 28, 2010, 09:11:40 AM

Title: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 09:11:40 AM
Anyone use AcDbDimData::setConstraint  with a custom object? I'm having a tough time figuring out how to do this properly.  I have two  AcDbDimData objects that can be tabbed though and have their dimensions changed. Once you have modified one of the objects, the object becomes locked, this part is all working. the problems is the entity(Rectangle) size does not get updated.  I can see it flicker but the size does not stick.
just looking for a sample, direction.. I've attached my project if anyone want to play  :laugh:

Thanks

Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 03:34:34 PM
have not used that in particular... will have a look into your code, later today.... no idea if I will be of some help :)

hmmm.... what the command doit it is supposed to do? (tried on A2009MEP) it simple draws a box and five grips and that's all... am I missing something? :(
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 07:00:17 PM
Thanks LE.3
you mean you don't see the DYN grips?
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 07:20:49 PM
Thanks LE.3
you mean you don't see the DYN grips?


Si
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 07:25:12 PM
hmmm is DYN on?
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 07:26:47 PM
hmmm is DYN on?
he he.... let me check... don't do any production work or drafting in a long time now (excuse: 10234.178a)  :evil:
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 07:32:37 PM
ok... here it is working.

edit: working on arch units - once I change that to decimal... i see the dimension stuck to the changed dim data but not the rectangle...

edit2: I see, now what do you mean... it works in some times both when I click on the tab and type a new dim, and all get updated.
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 08:37:19 PM
never used the dynamic input before, but it is supposed that once you click on the tab after typing a new value it will update the rectangle (or object)? or simple jump to the next available edit box?
and only will do the update if it is click on the enter?

edit: did a quick test on a normal rectangle... and once I use the dyn input, and the tab to change to another editbox, it simple does not update the object with the new value unless I hit enter.

do you want to be able to once you hit on the tab, to grab that value and pass it to your object?....

now I am confused... need a coffee..
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 09:06:22 PM
Right, for example with a line, you can tab over to the angle, enter in a value and the line is now constrained at that angle,
you can then tab back to the length and enter a value. This may be an issue with AcDbPolyline as its not behaving as expected either.
 Example, draw a rectangle, get a grip, and adjust the angle, it doesn't stick
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 09:10:07 PM
BTY, be careful when looking at the Autodesk samples, the AcGrip (in the Grip Sample) class fires off five dangling pointers each time you select a grip  :lol:
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 09:12:22 PM
BTY, be careful when looking at the Autodesk samples, the AcGrip (in the Grip Sample) class fires off five dangling pointers each time you select a grip  :lol:
i am aware of that, don't worried.... don't use much the samples et-al   :kewl:
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 09:16:01 PM
Right, for example with a line, you can tab over to the angle, enter in a value and the line is now constrained at that angle,
you can then tab back to the length and enter a value. This may be an issue with AcDbPolyline as its not behaving as expected either.
 Example, draw a rectangle, get a grip, and adjust the angle, it doesn't stick

ok, just tried with a single line and the tab works... but no workie on the rectangle, nor in your cobject....
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 28, 2010, 09:21:13 PM
Must be a pline problem
thanks, for your help LE.3.10234.178a
much appreciated
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 28, 2010, 09:23:47 PM
LE.3.10234.178a
he he...
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 29, 2010, 01:21:18 AM
did a quick new mickey mouse vs (with v) solution (2008) deriving by an AcDbEntity and adapting your code with some code here and appears that the tab change works in other words does the object update...

will upload it tomorrow land, now it is late for me... time to go to sleep.

1, 2, 3, 4, 5, ... z z z z zzzzzzzzzzzzzz.
Title: Re: AcDbDimData::setConstraint
Post by: Kerry on June 29, 2010, 01:47:05 AM
Must be a pline problem
thanks, for your help LE.3.10234.178a
much appreciated


For a moment there I thought that Luis had changed his name ....

 :wink:
Title: Re: AcDbDimData::setConstraint
Post by: ahlzl on June 29, 2010, 08:59:18 AM
Daniel,very good!
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 29, 2010, 09:15:28 AM
Thanks, I still have a bit of learning to do on this front  :-)
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 29, 2010, 10:10:29 AM
That was Daniel.... not me :)

Must be a pline problem
thanks, for your help LE.3.10234.178a
much appreciated


For a moment there I thought that Luis had changed his name ....

 :wink:
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 29, 2010, 10:24:16 AM
have to play a little more on this, will try to posted later today or asap.
did a quick new mickey mouse vs (with v) solution (2008) deriving by an AcDbEntity and adapting your code with some code here and appears that the tab change works in other words does the object update...

will upload it tomorrow land, now it is late for me... time to go to sleep.

1, 2, 3, 4, 5, ... z z z z zzzzzzzzzzzzzz.
Title: Re: AcDbDimData::setConstraint
Post by: LE3 on June 29, 2010, 12:26:00 PM
Here it goes, and the far i can get ... attached it is a VS9 sln target to A2010, incomplete project! (includes the bin files arx & dbx to test)

Have a look into the ani-image and notice that after a tab the object gets updated on screen.

So, must be something about the polyline.

Code: [Select]
class DLLIMPEXP CBox : public AcDbEntity {
HTH
Title: Re: AcDbDimData::setConstraint
Post by: It's Alive! on June 29, 2010, 07:07:32 PM
Thanks for looking LE,  for now I will just show the a single dynamic  dim.