| 
 | |||||||
| 
 | 
|  | 
|  | 
|  | Strumenti | 
|  24-10-2008, 16:09 | #1 | 
| Senior Member Iscritto dal: Apr 2000 Città: Piacenza d'Adige (PD) 
					Messaggi: 651
				 | 
				
				[C#] Utilizzare ElementSet in classi diverse
			 
		Salve di nuovo, sto iniziano a sviluppare un'applicaztivo in C# per Autodesk Revit, pur non conoscendo il C#   Ci sono quasi, però ho qualche difficoltà nel richiamare funzioni public da altre classi (o namespace). In particolare, in una classe ho queste righe: Codice: public IExternalCommand.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            // set out default result to failure.
            IExternalCommand.Result retRes = IExternalCommand.Result.Failed;
            Autodesk.Revit.Application app = commandData.Application;
            // get the elements selected
            // The current selection can be retrieved from the active 
            // document via the selection object
            SelElementSet selection = app.ActiveDocument.Selection.Elements;
            ..................La classe è public, ma come mai non riesco? Come dovrei fare? Grazie per la pazienza | 
|   |   | 
|  24-10-2008, 20:17 | #2 | 
| Member Iscritto dal: Jul 2005 
					Messaggi: 86
				 | 
		ciao, sinceramente non ho capito.. però se devi accedere a SelElementSet selection da un'altra classe perchè lo dichiari all'interno della funzione Execute? quando questa finisce SelElementSet muore con essa.. esempio: Codice: public class myclass
{
	public SelElementSet selection;
	public IExternalCommand.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            // set out default result to failure.
            IExternalCommand.Result retRes = IExternalCommand.Result.Failed;
            Autodesk.Revit.Application app = commandData.Application;
            // get the elements selected
            // The current selection can be retrieved from the active 
            // document via the selection object
            selection = app.ActiveDocument.Selection.Elements;
}
(dall'altra classe)
cc.Execute(....)
cc.selection | 
|   |   | 
|   | 
| Strumenti | |
| 
 | 
 | 
Tutti gli orari sono GMT +1. Ora sono le: 03:05.









 
		 
		 
		 
		






 
  
 



 
                        
                        










