Stopping user from getting into the background in ST6

Experimenter
Experimenter

Hello,
I have an addin in my site that stopes the users from getting into the draft background.
We are about to change to ST6, and in it there is a new command to get into the background: in the draft lower tab -> Edit Background {command id=11109}

I've added this command id to the addin BeforeCommandRun sub but this did not help.
The code stopes the background from showing when the user press the View->sheet Views-> Background {id=10211}. but when the user press the edit background the background does appear.
when I debug the code both commands fire the seTreminateAfterActivation command.
How can I solve this?

 

Private Sub BeforeCommandRun(ByVal theCommandID as Integer) Implements SolidEdgeFrameWork.ISEApplicationEvents.BeforeCommandRun
Static objCommand As SolidEdgeFramework.Command If theCommandID=10211 Or theCommandID=11109 Then objCommand=objSEapp.CreateCommand(SolidEdgeConstants.seCmdFlag.seTreminateAfterActivation) objCommand.Start() objCommand.Done= True objCommand=Nothing EndIf
EndSub

 

 

Thanks,

    Zohar

4 REPLIES

Re: Stopping user from getting into the background in ST6

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

On the AfterCommandRun event where the CommandID = 11109, do this:

application.StartCommand(SolidEdgeConstants.DetailCommandConstants.DetailViewBackgroundSheet);

My example code is in C# but you get the idea. The DetailViewBackgroundSheet is a toggle command so it will close the background sheets if they are displayed.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Stopping user from getting into the background in ST6

Creator
Creator

I just loved this way to let the code undo the command! Smiley Happy

 

The DetailViewBackgroundSheet = id 10211, so now I need some flag to know that the background sheets are not visable to edit (so I will not get into a loop)

 

I scanned the ObjDoc.ActiveSheet but could not find where SE holdes the state of is the backgrounds are in edit mode.

 

Do you know where it is? And if you do, how did you find it?

 

Thanks,

Zohar

Re: Stopping user from getting into the background in ST6

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

DOOD!!! Spy for Solid Edge is AWESOME...

 

I clicked on the "Type Browser" tab and searched for keyword "background". Scrolled through the hits looking for clues when I noticed that the SheetWindow has a DisplayBackgroundSheetTabs. That is the flag you're looking for and you can also use it rather than calling the StartCommand() that I previously recommended.

 

Community rocks!

Jason Newell
Applications Architect
www.jasonnewell.net

Re: Stopping user from getting into the background in ST6

Creator
Creator
This spy program is PURE GOLD!

Thanks