Kean Walmsley

July 2009

Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Twitter Updates

    follow me on Twitter



    « Creating a partial CUI file using .NET and loading it inside AutoCAD | Main | Using a jig from .NET to multiply insert AutoCAD blocks - Part 2 »

    May 18, 2007

    TrackBack

    TrackBack URL for this entry:
    http://www.typepad.com/services/trackback/6a00d83452464869e200d83576f95569e2

    Listed below are links to weblogs that reference Using a jig from .NET to multiply insert AutoCAD blocks:

    Comments

    How would you go about adding Attribute References to the jig prior to appending them to from the block table record?

    A good question... adding the attributes works fine once the block reference is in the database, but there appears to be a problem if the attributes are being added to the block reference before it gets appended. I'm checking in with our Engineering team on this.

    Kean

    OK - this currently isn't possible. Sorry for the bad news. I've posted some code to show how to append attributes after the jig process has completed in my next post.

    Kean

    Thanks for a good basic example of a 2D jig.

    If you ever get around to doing an example that supports 3D, keep in mind that with the Dynamic UCS feature, you have to read the current value of the Editor's CurrentUserCoordainateSystem property in each jig update, and transform your block using that. If you do, then the jig will support DUCS like any good 3D jig should

    Regarding support for dragging attributes and blocks, it can be done by creating the attributes and transforming each of them along with the block reference, without having to add them to the blockref.

    Newbie Question: What is a jig? Can you point me to a simple example (on this blog or elsewhere) using c# to insert one dynamic block ona drawing, then inserting a different type of dynamic block on the same drawing at a particular point on the first block. An example would be:
    1) insert a dynamic block that is a square. Set side length to 3000mm.
    2) at each corner of the square, insert a dynamic block that is a differnt sized circle. the center of each circle is located at each corner of the square. circle radius 1 = 500mm, 2 is 550 mm, 3 is 600mm, 4 is 650mm.
    The dynamic blocks that I am using are quite complex however so any help in describing how to work with inertion points is greatly appreciated.
    Thanks for a GREAT blog...even though most of it is going over my head at this point.

    --mspan

    Hi mspan,

    Here's the description of the AcEdJig class (the underlying ObjectARX class for a jig) from the ObjectARX Reference, part of the SDK:

    >>>
    The AcEdJig class is used to perform drag sequences, usually to acquire, create, edit, and add a new entity to the database. If you are deriving a new entity class, you will usually want to implement your own version of AcEdJig. This class enables the AutoCAD user to define certain aspects of an entity using a pointing device, and it gives the programmer access to the AutoCAD drag mechanism. (The class takes its name from “jig,” a device used to hold a machine part that is being bent or molded in place.)
    <<<

    I don't know of a pre-existing sample to do what you want - the requirement you've got is quite unusual, but not particularly difficult to solve. You have the control to do this from your app, for sure. Perhaps someone on the AutoCAD .NET Discussion Group will be able to help.

    Regards,

    Kean

    Hi Kean,

    You said that performing a rotation jig on an entity is quite simple. For a newbie like me, it's not so simple. Could you post an example or indicate me an example?

    Any help is greatly appreciated.

    Thanks,
    Danny

    P.S. Great blog!! You're my main source of knowledge...

    Hi Danny,

    As you asked so nicely... :-)

    Using a jig to rotate an AutoCAD entity via .NET

    Cheers,

    Kean

    Hi Kean,

    Is it possible to just drag all the attributes of a blockreference, without the blockref itself, in one motion? We have to insert a lot of blocks (with atts) each with a different orientation but we'd like to have all info (the atts) nicely aligned and horizontal (in WCS and UCS). Prompts like this:
    - insertionpoint block?
    - rotation block?
    - position of your attributes?

    Thought i got it using AcEdDragGen but it won't accept a sset with only subentities. AcEdJig doesn't seem to offer a solution either since it's single entities. I can move the atts in one motion with a rubberband but dragging would be nicer right?

    No can do?

    Regards,

    Frank Nauwelaerts

    Hi Frank,

    I can't see a way of doing this, without creating an intermediate block reference and replicating the attribute information but no geometry. You'd still have to get around the attribute jigging issue, of course.

    Cheers,

    Kean

    great blogs! your blog is my only dependable source. thanks a ton.

    Hi Kean,

    I "aceddraggen" temporary, plain textentities with the same appearance, instead of the attributes. Works like a charm, if i might say so myself.

    Thanks,

    Frank

    Thanks for sharing the tip, Frank!

    Kean

    Hi Kean,

    I want to placed block reference at some location without any interference. While placing a block I want to indicate to user whether it intersects with any other blocks or not. If it intersects then I want to change the color of block to 'RED' or otherwise 'BLUE'. Such that there is a need to find intersecting blocks and change the color while user drags a block.

    For that I have used EntityJig. I am using 'Sampler function' to change color of dragging
    block.

    I have used AcadSelectionSets and SelectByPolygon method in 'Sampler function' for getting intersecting blocks of Jig Entity. But I am getting selection count as 0 everytime even I have specified entire area to select all entities coming inside it.

    Is there any way to get intersecting selection set of EntityJig?

    Thanks in advance.
    VIKS

    Hi Viks,

    You work for an ADN member, so I suggest posting your question via the ADN site so one of my team can help you.

    During some selection commands I've been able to call Editor.SelectCrossingWindow() to find out the entities under the cursor, but I doubt it will work from a jig selection.

    ADN should be able to help more.

    Kean

    Verify your Comment

    Previewing your Comment

    This is only a preview. Your comment has not yet been posted.

    Working...
    Your comment could not be posted. Error type:
    Your comment has been posted. Post another comment

    The letters and numbers you entered did not match the image. Please try again.

    As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

    Having trouble reading this image? View an alternate.

    Working...

    Post a comment

    Feed & Share

    Search