myExt.Commit RFileName = FileName.Make("$USEREXT/myext.avx") WFileName = FileName.Make("$USEREXT/myext.tmp") RFile = LineFile.Make(RFileName,#FILE_PERM_READ) WFile = LineFile.Make(WFileName,#File_PERM_WRITE) WFile.SetScratch(TRUE) while (RFile.IsAtEnd.Not) buf = RFile.ReadElt if (buf.Contains("ObjectTag:").not) then WFile.WriteElt(buf) end end RFile.Close WFile.Flush File.Copy(WFilename, RFileName) WFile.CloseThis modification opens the avx file as a LineFile, creates a temporary file, and writes every line except ObjectTag lines in the avx file to the temporary file. Then the temporary file is copied to the avx file name.
If your customized DocGUI is a View or Layout, you may need to remove a few controls that the Dialog Designer installs into these DocGUIs. These controls are the "Show/Hide Control Tools" on the Windows menu and the "Design/Run Controls" on the Graphics menu. If your extension will not be dependent upon the Dialog Designer extension (dialog.avx), you should remove these menu options from these GUIs before you add them to your extension.
To remove the object tag and menu controls, add the following lines of code to your Make script where you add the View or Layout GUI.
'Get the customized View DocGUI from the project viewGUI = av.getproject.FindGUI("View") viewMenuBar = viewGUI.GetMenuBar 'Find separator that contains the object tag and set the object tag to nil winUpdate = viewMenuBar.FindByScript("WindowMenuUpdate") winUpdate.SetObjectTag(nil) 'Delete all the activate window menu options cSet = winUpdate.GetControlSet cList = cSet.GetControls last = cList.Get(cList.Count - 1) while (last <> winUpdate) cSet.Remove(last) last = cList.Get(cList.Count- 1) end 'Find the controls that were added by Dialog Designer and remove them showControlTools = viewMenuBar.FindByScript("GraphicControl.ShowHideTools") designControls = viewMenuBar.FindByScript("GraphicControl.DesignRun") showControlTools.GetControlSet.Remove(showControlTools) designControls.GetControlset.Remove(designControls) 'Then add your DocGUI to your extension myExt.Add(viewGUI)