stop running ilogic code when the assembly that is open Partnummer start with 2990 , possible

stop running ilogic code when the assembly that is open Partnummer start with 2990 , possible

Darkforce_the_ilogic_guy
Advisor Advisor
262 Views
2 Replies
Message 1 of 3

stop running ilogic code when the assembly that is open Partnummer start with 2990 , possible

Darkforce_the_ilogic_guy
Advisor
Advisor

I have some code that I dont want to run as normalt, when it is a part of  a special group of files.

 

My problem is that want the code not just to stop running on that files .. but all that is save ... at the same save commmand..

 

So I need to know a way what partnummer is current open in inventor aktive viewport.  so it does not run the code if the current open file in inventor partnummer is start with 299000 ... nu matter that the save inventor current in saving

 

 

 

0 Likes
Accepted solutions (1)
263 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor

If I understand well.

  • You are saving the top assembly
  • Some files need to be saved also (sub-documents)
  • You want to do something with this sub-documents
  • But do nothing when the top assembly PartNumber starts with 299000

Right?

0 Likes
Message 3 of 3

Darkforce_the_ilogic_guy
Advisor
Advisor
Accepted solution

yes and no.  

 

I have a code the normaly run on all files, but because of performes.. I want it to not run on any one of  the files if the  top assembly is PartNumber starts with 299000  because thoes files is offen very large and might have +4000 files in them 

 

I am already test i code that seens to work ' feel free to come with other way to do it 🙂

 

Try
	'stop code if layout "299000"
	'Dim doc = ThisApplication.ActiveDocument
Dim doc = ThisApplication.ActiveView.Caption
Dim doc2 = ThisApplication.ActiveDocument

Logger.Info("Aktive doc " & Left(doc.ToString,6), "Save doc" & iProperties.Value(doc2, "Project", "Part Number") )
If Left(doc.ToString, 6) = "299000" Then
Logger.Info("This is an layout", filename)

Exit Sub
End If 
Catch
	
End Try

 

0 Likes