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

[ACAD2013] Passing a parameter to a DBX module

6 REPLIES 6
Reply
Message 1 of 7
gatti.massimo
334 Views, 6 Replies

[ACAD2013] Passing a parameter to a DBX module

Hi Everybody,

I developed a custom entity extending a AcDbLine.

In the subworldDraw I draw a text in the middle of the line.

I would like to use a parameter that I configure one time from the ARX module and then I force all my entities to redraw.

 

How can I pass this parameter to the DBX module?

 

From the DBX module I can't access to the ARX module.

 

Thanks for your time.

 

Have a good day,

Massimo

6 REPLIES 6
Message 2 of 7
owenwengerd
in reply to: gatti.massimo

There are very likely many different ways to achieve your goal. This is how I would approach the problem. If the entity's graphic representation depends on the parameter, then the parameter should probably belong to the entity class as a class member. If all entities of that class share the same parameter, then it should either be a static member of the class or else, if the parameter should be database resident, it should be in a dictionary owned by the NOD (Named Objects Dictionary) with the dependency properly expressed by mutual soft pointers filed by both classes.

--
Owen Wengerd
ManuSoft
Message 3 of 7
gatti.massimo
in reply to: owenwengerd

Hi,

perfect, I stored it in a dictionary and I retrieve it in the subWorldDraw (AcGiWorldDraw *mode) routine of the entity.

 

When I change this parameter with a form, I would like to redraw all the graphics.

 

How can I cause the subWorldDraw for the whole drawing?

 

Thank you so much.

 

Message 4 of 7
owenwengerd
in reply to: gatti.massimo

If your parameter object maintains a cross-reference list of entities as I suggested, then it can notify all of those entities when a change occurs. The notified entities can then mark their graphics as modified (e.g. by calling recordGraphicsModified()).

--
Owen Wengerd
ManuSoft
Message 5 of 7
gatti.massimo
in reply to: owenwengerd

Hi,

I use that parameter only to change the size of text labels on all the AcDbLines.

 

It's a function used only at the end of the process to print the drawing.

 

So, does exists a command to refresh everything, or should I call the recordGraphicsModified(true); on all the entities?!

 

Thank you so much,

Massimo

Message 6 of 7
nick83
in reply to: gatti.massimo

imho, you even don't need to think of refreshing at all.
when you modify your entity by properties window (if you have a wrapper) or using arx code in you modify command, you have to open entity for write, then modify some parameters and close it. that's all. if dbx logic is correct, autocad have to update your entity with a new params AUTOMATICALLY.

for example, one of my custom entities 🙂

sample.gif

Message 7 of 7
gatti.massimo
in reply to: nick83

Hi,

the problem is that I change that setting in one object stored in the NOD and that object is not related to any acdbentity, and that parameter is used in the subworlddraw of the acdbentity to draw a string on it, but the instances of the acdbentities don't know that they have to call the subworlddraw because I changed nothing on tha acdbEntity instance.

 

This is why I would like to cause the subworld draw of the entire document.

 

What to do?

 

Thank you for your time,

Nice railroad application! Good Job!

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

Post to forums  

Autodesk Design & Make Report

”Boost