.NET

Reply
Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 1 of 4 (246 Views)
Accepted Solution

Multiple overrules?

246 Views, 3 Replies
11-01-2012 06:27 AM

Hi there,

I have created an overrule in AutoCAD with a regapp name of "OVERRULE_1".  Added it to a polyline and away we go.  Everything is fine.  I have then created another overrule with a new appname " OVERRULE_2" and this one won't work unless I start the session again.  I have been able to separate them out adding extra value in the xdata.  But this essentially means only one app name for all my overrules and separated through x-data.  Is this the correct way?

 

When it comes to start up I tried to start them up the same way but it only ever chooses the first one and loads that Ok.

 

If rat.Has("OVERRULE_1") = False Then

                If Draw.Overruling = False Then

                    ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

If rat.Has("OVERRULE_2") = False Then

                If Draw.Overruling = False Then

                    ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

 

Ta,

 

Maritn.

My name is Martin.. :smileyvery-happy:

Thanks for your help people,

but I solved it.  The overrule was set to activate in the initialize component was hitting the first one and starting it.  When it got to the second one, it was already registered as being active so didn't start it.  I moved these 2 lines out of the two if statements, and made it just one line of code.

 

 

If rat.Has("OVERRULE_1") = False Then

                If Draw.Overruling = False Then

                     '  ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

If rat.Has("OVERRULE_2") = False Then

                If Draw.Overruling = False Then

                    '  ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

' New

Overrule.Overruling = True

 

Ta,

 

Maritn.

Valued Mentor
jeff
Posts: 331
Registered: ‎05-12-2009
Message 2 of 4 (234 Views)

Re: Multiple overrules?

11-01-2012 11:55 AM in reply to: quigs

You might want to show more code because it looks like you are adding the same overrule with different Xdata filters.

 

 

You can also find your answers @ TheSwamp
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 3 of 4 (220 Views)

Re: Multiple overrules?

11-01-2012 03:29 PM in reply to: quigs

Your code doesn't use multiple overrules.

 

Multiple overrules means that you are creating multiple instances of the overrule-based class.

 

You are adding the same instance of that class twice.

 

 

Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 4 of 4 (202 Views)

Re: Multiple overrules?

11-02-2012 01:39 AM in reply to: quigs

Thanks for your help people,

but I solved it.  The overrule was set to activate in the initialize component was hitting the first one and starting it.  When it got to the second one, it was already registered as being active so didn't start it.  I moved these 2 lines out of the two if statements, and made it just one line of code.

 

 

If rat.Has("OVERRULE_1") = False Then

                If Draw.Overruling = False Then

                     '  ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

If rat.Has("OVERRULE_2") = False Then

                If Draw.Overruling = False Then

                    '  ObjectOverrule.AddOverrule(RXClass.GetClass(GetType(Line)), Draw.theOverrule, True)

                End If

            DrawOverrule.Overruling = True

End If

 

' New

Overrule.Overruling = True

 

Ta,

 

Maritn.

My name is Martin.. :smileyvery-happy:
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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