• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Mentor
    KerryBrown
    Posts: 259
    Registered: ‎11-29-2008

    Re: overrule is really confusing ....

    09-09-2012 11:28 PM in reply to: JanetDavidson

     

    I don't have time to play. but : Just a WAG.

    Are your entitys being redrawn while they are being selected for the DIST command ??

    If so, this may be causing havoc with some of the AutoCAD Assemblies behind the scenes.

     

    As I said, just a guess.

     

    //-------------

    And just for my curiosity : why do you have 2 attribute tags with the same name ??

     

     

     

     

     

     

     

    //-------------------------------------------------------

    class keyThumper<T> : Lazy<T>;      another  Swamper


    I do not endorse the social media app links below:smileyembarrassed:

    Please use plain text.
    Valued Mentor
    Posts: 312
    Registered: ‎05-06-2012

    Re: overrule is really confusing ....

    09-09-2012 11:39 PM in reply to: JanetDavidson

    JanetDavidson wrote:

     

    originally in my code had a [ ref ] for ListEnts, which in your revised version it was removed.

     Below is what I had originally

    if (!toverrule.GetExplodedEnts(myBlock,ref ListEnts))

    and this is your revised one

    if (!toverrule.GetExplodedEnts(myBlock,ref ListEnts))

     

    I had to put ref back to make the code work properly

     


    Hi Janet. 'ref' (or ByRef in VB) is not necessary in both the call and the called method's argument list. The object you're passing (a List<Entity>) is a reference type, which is implicitly passed by reference (e.g, a copy of the object is not passed, only a reference to it). So, when you are writing methods that take reference types as parameters, you should never use 'ref' (or 'ByRef' in VB). 

    Please use plain text.
    Mentor
    Posts: 241
    Registered: ‎05-12-2009

    Re: overrule is really confusing ....

    09-10-2012 12:34 AM in reply to: DiningPhilosopher

    Hey guys,

     

    I think the problem stems from having attribute reference's.

     

    Janet if you try your code on a block without attributereferences does it still crash?

     

    I guess it would need to call get GetObjectSnapPoints() on the attribute references also.

     

     

    Should  a blockrefence just handle insertion snap point, and let the entites inside the definition handle the overloaded GetObjectSnapPoints with insertionMatrix?

     

    But GetObjectSnapPoints uses graphics on the screen I think?

    You can also find your answers @ TheSwamp
    Please use plain text.
    Distinguished Contributor
    JanetDavidson
    Posts: 139
    Registered: ‎08-23-2011

    Re: overrule is really confusing ....

    09-10-2012 05:50 AM in reply to: jeff

    Jeff.

    I did a lot of try and error to narrow down the problem. Yes, this happens if block has attribute and in or overrule we try to draw a  polyline. I did a circel instead of polyline and this doesn't happen.

        I am not a pro and don't understand your other suggestions and questions. Sorry . My fault . You helped   me beofre a lot of times and you know my skills are very limited. Sorry again. 

     

    Kerry.

    Quote<

    Are your entities being redrawn while they are being selected for the DIST command ??

    Quote>

     

    How  would I know ? It crashes before I do anything. If you don't have time please dont' waste your time to read this thread I will send you a private message when it is solved! Typical Kerry

     

     

    Quote<

    And just for my curiosity : why do you have 2 attribute tags with the same name ??

    Quote>

    It was just accident . Even having one attribute  cause this crash.

     

     

    Tony.

    AutoCad 2012 64 -  Windows 7 -

    Any Running Snaps make this happen.

     

    Thank you gentlemen for looking into this.

     

     

    Regards,

    Janet.

     

     


     

     

     

     

     

    Please use plain text.