Newsgroup: it.comp.software.cad
Titolo: File IGES

Ciao a tutti. Vorrei sapere se c'è un modo,
aprendo un file iges, di risalire a quale programma
cad lo ha generato.  Grazie 

 2D Parametric for 2000-2008 <
(strcat "I like " (substr (ver) 8 4) "!")
--

ciao Marco,
è tornato utile il tuo lisp per cancellare i dati estesi,
 se hai una versione migliore puoi inserirla qui
http://www.newsland.it/nr/browse/it.comp.software.cad/8763.html
-- 
questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news
 segnala gli abusi ad 
ab...@newsland.it

 se hai una versione migliore puoi inserirla qui
Ciao Arri,
non so se hai questa versione "Visual", l'autore originale è
Juerg Menzi (Svizzera), io ho fatto qualche modifica.
=>>> To delete Xdata, call the function with Application Name only:
=>>>  (ALE_XData_Write VlaObj '((1001 . "MyApp1")))
Inseriscila dove vuoi.
Cheers.
Marco
;
; Marc'Antonio Alessi - 
http://xoomer.alice.it/alessi
; Function: ALE_XData_Write - old name ALE_SetXdata
;
; Credits: Juerg Menzi
;
; Version 1.00 - 01/03/2006
;
; Description:
;    Writes list of Xdata into an entity
;
; Arguments:
;   VlaObj = Object to write Xdata [VLA-OBJECT]
;   In_Lst = List of Xdata '((Field1 . Data1)...(Fieldx . Datax)) [LIST]
;
; Return:
;   > True if succeed
;   > False if fail
;
; Use (example for Dimensions):
;   (ALE_XData_Write (vlax-ename->vla-object (car (entsel)))
;    '(
;       (1001 . "ACAD_DSTYLE_DIMEXT_LENGTH")  (1070 . 378) (1040 . 4.0)
;       (1001 . "ACAD_DSTYLE_DIMEXT_ENABLED") (1070 . 383) (1070 . 1  )
;     )
;   )
;
; Notes:
;   To delete Xdata, call the function with Application Name only:
;   (ALE_XData_Write VlaObj '((1001 . "MyApp1")))
;
(defun ALE_XData_Write (VlaObj XDtLst / FldArr DatArr AltStr)
  (setq
    FldArr (ALE_XData_ListToVariant (mapcar 'car XDtLst) vlax-vbInteger)
    DatArr (ALE_XData_ListToVariant (mapcar 'cdr XDtLst) vlax-vbVariant)
  )
  (if
    (vl-catch-all-error-p
      (setq AltStr
        (vl-catch-all-apply 'vla-SetXData (list VlaObj FldArr DatArr))
      )
    )
    (alert (vl-catch-all-error-message AltStr))
    T
  )
)
;
; Marc'Antonio Alessi - 
http://xoomer.alice.it/alessi
; Function: ALE_XData_ListToVariant - old name ALE_XlistToVariant
;
; Credits: Juerg Menzi
;
; Version 1.00 - 01/03/2006
;
; Description:
;    Converts a list to an array for XDatas
;
; Arguments:
;   DatLst = Data list [LIST]
;   DatTyp = Variable type [INT]
;
; Return:
;   > Data array [VARIANT]
;
; Use (example for Dimensions):
;   (ALE_XData_ListToVariant
;    '(1001 1070 1040 1001 1070 1070)
;     vlax-vbInteger
;   )
;   (ALE_XData_ListToVariant
;    '("ACAD_DSTYLE_DIMEXT_LENGTH" 378 4.0 "ACAD_DSTYLE_DIMEXT_ENABLED" 383 1)
;     vlax-vbVariant
;   )
;
(defun ALE_XData_ListToVariant (DatLst DatTyp)
  (vlax-make-variant
    (vlax-safearray-fill
      (vlax-make-safearray DatTyp (cons 0 (1- (length DatLst))))
      (mapcar
       '(lambda (LmbDat)
          (if (= (type LmbDat) 'LIST)
            (vlax-safearray-fill
              (vlax-make-safearray vlax-vbDouble (cons 0 (1- (length LmbDat))))
              LmbDat
            )
            LmbDat
          )
        )
        DatLst
      )
    )
  )
)

 se hai una versione migliore puoi inserirla qui
Questa mi pare di avertela già inviata tempo fa:
; Marc'Antonio Alessi - 
http://xoomer.alice.it/alessi
; Function: ALE_DelXdataSs
;
; Version 1.01 - 08/04/2003
; Version 1.02 - 01/06/2006
; Version 1.03 - 15/06/2006
;
; Description:
;   delete XData of specified APPID(s)
;
; Arguments:
;   BitFlg = 1 prompts ON 
;   BitFlg = 2 erase Xdata on all objects
;
; Use:
;   (ALE_DelXdataSs '("MyApp1" "MyApp2") 1)
;   delete by AppID's and by selection
;   or
;   (ALE_DelXdataSs '("*") 3)
;   delete all xdata of all AppID's from all objects
;
; Comments:
;   The filter in ssget is not useful, because in case of a block with
;   Attribute Xdata only, it doesn't work.
;   The argument of the function should be a list. This allows you to
;   delete Xdata's with different AppID's.
;
(defun ALE_DelXdataSs (ApsLst BitFlg / SsXdat ApsStr EntNam EntDat Countr)
  (setq ApsStr "")
  (foreach AppNam ApsLst
    (setq ApsStr (strcat ApsStr "," AppNam))
  )
  (if (= 2 (logand 2 BitFlg))
    (setq SsXdat (ssget "_X" (list (list -3 (list (substr ApsStr 2))))))  
    (setq SsXdat (ssget      (list (list -3 (list (substr ApsStr 2))))))  
  )
  (cond
    ( SsXdat 
      (repeat (setq Countr (sslength SsXdat))
        (setq
          Countr (1- Countr)
          EntNam (ssname SsXdat Countr)
          EntDat (entget EntNam ApsLst)
        )
        (ALE_DelXdataEnt EntNam EntDat)
        (and
          (= "INSERT" (DXF 0 EntDat))
          (= 1 (DXF 66 EntDat))
          (while
            (and
              (setq EntNam (entnext EntNam))
              (= "ATTRIB" (DXF 0 (setq EntDat (entget EntNam ApsLst))))
            )
            (ALE_DelXdataEnt EntNam EntDat)
          )
        )
      );repeat
      (and (= 1 (logand 1 BitFlg)) (princ "\nEliminazione Xdata eseguita.  "))
    )
    ( (= 1 (logand 1 BitFlg))
      (princ "\nNon è stato trovato nessun oggetto con Xdata.  ")
    )
  )
)
; Use:
; (ALE_DelXdataEnt ename '("MyApp1" "MyApp2"))
;
; In AutoCAD 14 Xdata on dimension entities will be not erased if they are
; substituted with an empty list when there are no Xdata of another
; application, see AND condition.
;
(defun ALE_DelXdataEnt (EntNam EntDat / TmpLst)
; (and
;   (= 14 (atoi (getvar "ACADVER")))
;   (eq "DIMENSION" (DXF 0 EntDat))
;   (not (DXF -3 (entget EntNam '("ACAD"))))
;   (entmod (list (cons -1 EntNam) '(-3 ("ACAD" (1000 . "DSTYLE")))))
; )
  (foreach ForElm (DXF -3 EntDat)
    (setq TmpLst (cons (list (car ForElm)) TmpLst))
  )
  (entmod (list (cons -1 EntNam) (cons -3 TmpLst)))
)
; For single AppName (Doug B.) - Use: (ALE_DelXdata1AppEnt ename "MyApp1")
(defun ALE_DelXdata1AppEnt (EntNam AppNam)
  (entmod (list (cons -1 EntNam) (list -3 (list AppNam))))
)
; DXF Funzione di ricerca codici dxf.
(defun Dxf (DxfCod EntDat) (cdr (assoc DxfCod EntDat)))

aggiorno subito,
grazie mille Marco !!!


> grazie mille Marco !!!
Ecco la parte che mancava per renderla simile a "ALE_DelXdataSs".
Forse si può fare di meglio, in quasi tuti i casi mi sembra più
veloce.
Ciao.
Marco
; Marc'Antonio Alessi - 
http://xoomer.alice.it/alessi
; Function: ALE_XData_DeleleteBySelSet
;
; Version 1.00 - 06/03/2008
;
; Description:
;   delete XData of specified APPID(s)
;
; Arguments:
;   ActDoc = (vla-get-ActiveDocument (vlax-get-Acad-Object))
;   ApsLst = AppId names list > '("MyApp1" "MyApp2")
;   BitFlg = 1 prompts ON 
;   BitFlg = 2 erase Xdata on all objects
;
; Examples:
;  (or *AcadApp* (setq *AcadApp* (vlax-get-Acad-Object)            ))
;  (or *AcAcDwg* (setq *AcAcDwg* (vla-get-ActiveDocument *AcadApp*)))
;
;  (ALE_XData_DeleleteBySelSet *AcAcDwg* '("MyApp1" "MyApp2") 1)
;    delete by AppID's and by selection
;
;  (ALE_XData_DeleleteBySelSet *AcAcDwg* '("*") 3)
;    delete all xdata of all AppID's from all objects
;
(defun ALE_XData_DeleleteBySelSet (ActDoc ApsLst BitFlg / RegAps XdtLst SsXdat ActSst ApsStr EntNam EntDat Countr)
  (setq ApsStr "")
  (vlax-for ObjFor (vla-get-registeredapplications ActDoc)
    (setq RegAps (cons (vla-get-name ObjFor) RegAps))
  )
  (foreach AppNam ApsLst
    (setq ApsStr (strcat ApsStr "," AppNam))
    (and (member AppNam RegAps) (setq XdtLst (cons (cons 1001 AppNam) XdtLst)))
  )
  (if (= 2 (logand 2 BitFlg))
    (setq SsXdat (ssget "_X" (list (list -3 (list (substr ApsStr 2))))))  
    (setq SsXdat (ssget      (list (list -3 (list (substr ApsStr 2))))))  
  )
  (cond
    ( (and SsXdat (setq ActSst (vla-get-ActiveSelectionSet ActDoc)))
      (vlax-for ObjFor ActSst
        (and
          (= "*" (car ApsLst))
          (setq XdtLst (ALE_XData_GetAppNames (ALE_XData_Get ObjFor "")))
        )
        (ALE_XData_Write ObjFor XdtLst)
        (and
          (= (vla-get-objectname ObjFor) "AcDbBlockReference")
          (not (vlax-property-available-p ObjFor 'Path))     ; not Xref
          (= (vla-get-hasattributes ObjFor) :vlax-true)
          (foreach ForElm (vlax-invoke VlaObj 'GetAttributes)
            (and
              (= "*" (car ApsLst))
              (setq XdtLst (ALE_XData_GetAppNames (ALE_XData_Get ForElm "")))
            )
            (ALE_XData_Write ForElm XdtLst)
          )
        )
      )
;|i|; (and (= 1 (logand 1 BitFlg)) (princ "\nEliminazione Xdata eseguita.  "))
;_e__ (and (= 1 (logand 1 BitFlg)) (princ "\nXdata erased.  "))
    )
    ( (= 1 (logand 1 BitFlg))
;|i|; (princ "\nNon è stato trovato nessun oggetto con Xdata.  ")
;_e__ (princ "\nNo objects with Xdata found.  ")
    )
  )
)
;
; Marc'Antonio Alessi - 
http://xoomer.alice.it/alessi
; Function: ALE_XData_GetAppNames
;
; Arguments:
;   XDtLst = List of Xdata '((Field1 . Data1)...(Fieldx . Datax)) [LIST]
;
(defun ALE_XData_GetAppNames (XDtLst / TmpLst OutLst)
  (while (setq TmpLst (assoc 1001 XDtLst))
    (setq
      OutLst (cons TmpLst OutLst)
      XDtLst (cdr (member TmpLst XDtLst))
    )
  )
  OutLst
)