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

Is it possible to draw without adding to DB - Jig Like ? (emulate a jig?)

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
ognyandim
663 Views, 5 Replies

Is it possible to draw without adding to DB - Jig Like ? (emulate a jig?)

I want to draw some lines but I want them disapear after a move or regen or something else, but not with jig. Something like emulating jig. Is that possible and how? Is it a trick with thse

 

 CurrentSpace.AppendEntity();
 Transaction.AddNewlyCreatedDBObject();
 Transaction.Commit();

 

or not?

 

Is it called  non-database-resident object? If so, how can I make it?

 

Something like parametrizing the draw method using parameters form - not from an Editor.drag() sampler.

 

I want to redraw an object based on form options and after making the desired options - draw it for real.

5 REPLIES 5
Message 2 of 6
norman.yuan
in reply to: ognyandim

If you use Acad2009 or later, TransientGraphic would be what you need. I have a few articles with code sample on using TransientGraphic that may be of help to you.

 

http://drive-cad-with-code.blogspot.com/

 

Message 3 of 6
ognyandim
in reply to: ognyandim

I will reply to myself in case someone else runs across this problem. I solved it that way :

1 ) Created a Form with which I pick all the settings needed for my custom object.

2 ) Created a class that contains my REDRAW() method that draws the object I want with dependence to the settings from the form

3 ) Created a structure with which I pass the settings from the Form to the class.

4 ) I make an instance of the form in the top left.

5 ) OnEvent (whatever event you want - radio button, numeric drop down, etc.) I get the data from the form and send it to the REDRAW() method in order to redraw my object with the new settings.

6 ) I keep all the drawable objects ( polylines, arcs, dimension lines, leaders, etc. ) in ObjectCollections, so I can delete them when I call REDRAW or modify them accordingly to the settings.

7 ) When the object satisfies me - I press OK and the object remains in the database.

8 ) If I press Cancel I use the object collection to remove the objects from the DB.

 

In other words -

1. make a form with which you gather your settings from the user,

2. make a class that instantiates the form and has a object collection to contain your custom object details (polys, arcs, lines etc)

3. and a dredraw() method in the class that accepts the settings (struct) and draws your object OnEvent (Any suitable event)

 

The visual effect is that my custom object gets redrawn every time I change a thing in my form and that form do not close, but sits still on the left leaving me to see my changes on the fly!

Its like transient graphics ( jig like ) with a form acting like a dynamic object - constructed and redrawn on every change in the form.

 

If somebody is interested and wants an example - I will make for him a simple one and will post it. For now I will not, because I don`t see interest on the topic.

Message 4 of 6

Ognyandim,

 

I would be interested in seeing the code you came up with. If it works the way I suspect it does from your description, I have an idea or two in which such a feature would come in handy.

 

So, I woud be grateful if you could share some of your code on this.

 

 

Thanks,

Steve

 

Steven Elliott

When I was a little bitty boy, my grandmother bought me a cute little toy. Silver bells hangin' on a string... she told me it was my ding-a-ling-a-ling!
Message 5 of 6
ognyandim
in reply to: ognyandim

The example is in SHP.sample.zip. I have removed only the content of the draw method. This is a beta version of one of our functions. We make unfoldings of 2D and 3D sheet profiles. This is a sample from a sheet profile generator. Other functions work similiar to this.

Message 6 of 6
ognyandim
in reply to: ognyandim

Here is a short movie of what the program actualy does. You can make whatever this way. We prefer making stuff this way, because dynamic blocks with lots of properties are too hard to make and consume much time to edit. We look for objects that have steps in the way they are constructed and then we automate them.


Here we have an example of Unfolding of a 3D or 2D sheet profile that has 3 steps - constructing it directly from poly (SHP.example) from poly, unfolding with bend decution or K-factor method (3D or 2D), and then we place a leader with different specs - paintable area in square meters, linear weight, etc.

 

http://www.mediafire.com/file/42sox4dm2g4szee/sheetGenerator.avi

 

Secondly we separete the input from the drawing process and using outside math library we can port our algorithm to other platforms - Rhino, Ares, AutoCAD, Zw, Gstar... whatever.

 

We have discovered that this is the best way that satisfies our need and ofcourse given our demands to modify classes, reuse parts of code, make similar interface for all our funx.


I suppose that this will be a good technique for other programmers and will save the day sometimes.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost