.NET

Reply
Valued Mentor
KerryBrown
Posts: 269
Registered: ‎11-29-2008
Message 21 of 24 (163 Views)

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

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 22 of 24 (162 Views)

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). 

Valued Mentor
jeff
Posts: 330
Registered: ‎05-12-2009
Message 23 of 24 (155 Views)

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
Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 24 of 24 (135 Views)

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.

 

 


 

 

 

 

 

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.