ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change hatch boundaries of a custom entity derived from AcDbText?

4 REPLIES 4
Reply
Message 1 of 5
maisoui
409 Views, 4 Replies

How to change hatch boundaries of a custom entity derived from AcDbText?

Hi,

 

I created a simple entity derived from AcDbText and my goal is to provide different hatch boudaries to the "hatching process" instead of the standard background mask of a text. Like for other custom entities, I implemented the subExplode function to define hatch boudaries but it doesn't work. This function don't seem to be called by "hatching process".

I know that a trick would be to have a AcDbText embedded in a "simple entity", but I don't want this solution because I need all defined functions of AcDbText.

 

If there is no solution, can we at least tell AutoCAD to ignore certain texts for hatching?

 

Any suggestions?

Regards,

--
Jonathan
4 REPLIES 4
Message 2 of 5
moogalm
in reply to: maisoui

Hi ,

 

I want to confirm if I understood your query correctly , are you trying to change the hatch pattern on text entity while your custom text entity getting drawn ?

 

Can you please clarify "Change hatch boundary of text entity " ?

 

 

Message 3 of 5
maisoui
in reply to: moogalm

Sorry if I was not clear enough. This time, I will try with a picture Smiley Wink

 

acdbtext_hatch_1.png

 

What I want:

acdbtext_hatch_2.png

 

How to tell AutoCAD that the "boundaries" of my entity (derived from AcDbText) are an ellipse or a square or ... when user uses hatch command?

Regards,

--
Jonathan
Message 4 of 5
moogalm
in reply to: maisoui

 I don't think it is possible , from API perspective we don't have control over this , while Hatching ,it definitely detects from Text and appends TextBox to hatchloop , but we can't modify the textbox 😞

 

One thing I noticed , if you draw a ellipse enveloping text entity , hatch process does hit subexplode of text entity.

Message 5 of 5
nick83
in reply to: moogalm

I implemented the subExplode function - post your code. mb this will help

imho, possible variants:

1. somethig wrong with your subExplode

2. mb it's impossible for acdbtext to do what you want. so, you need to use another base class, for example, polyline and embed your acdbtext as a variable of that class

 

anyway, for my custom object (acdbpolyline) it works.
my subExplode code:

Acad::ErrorStatus CAcDbChain::subExplode(AcDbVoidPtrArray & entitySet) const
{
  assertReadEnabled();
  for(int i = 0; i < mEntities.length(); i++)
  {
    AcDbEntity* clonedEntity = (AcDbEntity*)mEntities[i]->clone();
    if(clonedEntity) entitySet.append(clonedEntity);
  }
  return Acad::eOk;
}

 

CAcDbChain - public AcDbPolyline

mEntities - an array of non database entities drawn instead of base polyline

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost