Author Topic: AcDbDimAssoc  (Read 2723 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
AcDbDimAssoc
« on: September 23, 2023, 08:00:43 AM »
is this wrapped for .NET? I see it for BricsCAD , but not in autocad

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: AcDbDimAssoc
« Reply #1 on: September 23, 2023, 11:31:27 AM »
Hi Daniel,

As far as I know, it is not.
I can see the ACAD_DIMASSOC entry in the extension dictionary of an associative dimension which RXClass name is AcDbDimAssoc. But it is only exposed as DBObject (no specific properties).
Speaking English as a French Frog

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: AcDbDimAssoc
« Reply #2 on: September 23, 2023, 04:46:56 PM »
Thanks Gile!
I’m wrapping it for python and I sometimes use .NET’s naming convention, when I run into a nested Emum class.
I’ll use Teigha’s DimAssocPointType for this case

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2148
  • class keyThumper<T>:ILazy<T>
Re: AcDbDimAssoc
« Reply #3 on: September 23, 2023, 06:29:36 PM »
Perhaps a post in Feature Requests on the Venn Alpha forum would help others Daniel.
. . . at least make the issue known.

There are couple of requests that deserve an upvote there.

Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: AcDbDimAssoc
« Reply #4 on: September 23, 2023, 09:39:48 PM »
Perhaps a post in Feature Requests on the Venn Alpha forum would help others Daniel.
. . . at least make the issue known.

There are couple of requests that deserve an upvote there.

Hi Kerry,

Good idea, though, I have not investigated if .NET provides another way of associating dimensions to geometry
There’s a bunch of other *Assoc* classes, some of which my not be in ARX

I’ll keep a list of classes that may be missing as I work though creating wrappers


Code: [Select]
AcDbPointRef
AcDbOsnapPointRef
AcDbDimAssoc

AcDbDimAssoc::PointType or  DimAssocPointType (BricsCAD)
AcDbDimAssoc::AssocFlags or AssocFlags(BricsCAD)
AcDbDimAssoc::RotatedDimType or RotatedDimType(BricsCAD)


kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2148
  • class keyThumper<T>:ILazy<T>
Re: AcDbDimAssoc
« Reply #5 on: September 23, 2023, 10:38:22 PM »
The associated dims issue is weird in regard to documentstion.

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-27B4098E-AA85-4F02-8C60-E87558E67D4B

Quote
Understand Associative Dimensions (.NET)
Associative dimensions automatically adjust their locations, orientations, and measurement values when the geometric objects associated with them are modified. The DIMASSOC system variable controls associative dimensioning. Set DIMASSOC to 2 to turn on associative dimensioning.

. . . and that's it.

The way I read that is : just set DIMASSOC to 2 and magic happens  ??


I'll try it one day , perhaps.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: AcDbDimAssoc
« Reply #6 on: September 23, 2023, 11:15:05 PM »
well that's certainly less verbose than
https://www.theswamp.org/index.php?topic=58593

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8759
  • AKA Daniel
Re: AcDbDimAssoc
« Reply #7 on: September 23, 2023, 11:43:13 PM »
It’s a little weird from a memory perspective, so I can see a reason why Autodesk may have not implemented this
AcDbPointRef cannot be garbage collected after it’s added AcDbDimAssoc, otherwise it will crash.

Oda uses reference counting, I have a flag in Python’s analog to DisposableWrapper to handoff ownership in setPointRef

Code - C++: [Select]
  1. void PyDbDimAssoc::setPointRef(int ptType, PyDbPointRef& ptRef)
  2. {
  3.     PyThrowBadEs(impObj()->setPointRef(ptType, ptRef.impObj()));
  4.     ptRef.forceKeepAlive(true); //never gets here on exception
  5. }
  6.  
  7. PyDbPointRef PyDbDimAssoc::pointRef(int ptType) const
  8. {
  9.     //uses a const CTOR, autoDelete = false
  10.     //const AcDbPointRef* pointRef(int ptType) const;
  11.     return PyDbPointRef(impObj()->pointRef(ptType));
  12. }
  13.  

Hopefully this won’t come back to bite me.
A, I’ll add test coverage,
B, I’ve made DisposableWrapper flags public to python so users can intercept before garbage collection