Autore |
Discussione  |
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 03 settembre 2009 : 10:03:44
|
256 è il numero massimo dei Layout per ogni dwg
Per superare questo limite si può utilizzare questo dwg contenente 302 Layout |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 08 settembre 2009 : 12:44:10
|
Recuperare la definizione di hatch da un dwg
http://www.turvill.com/t2/free_stuff/getpat.lsp
;|
GETPAT.LSP (c) 2001 Tee Square Graphics Version 1.01b - 1/22/2002
This routine may be used to extract hatch pattern data from existing drawings when the .pat file containing the original information is not available.
After loading the file in the usual manner, type the command GETPAT at the AutoCAD Command: prompt, select any (non-SOLID) hatch object, and the pattern information will be written to a .pat file having the same name as the pattern (e.g., pattern information for the hatch pattern WOODS will be written to WOODS.PAT.
Ver. 1.01b includes two small fixex to eliminate "Bad Argument" LISP errors when run with certain installations of AutoCAD 2000+.
|;
(defun C:GETPAT (/ cmde hat elst rotn hnam temp xofs yofs what temp outf flin angl tmp1 tmp2 xvec yvec) (setq cmde (getvar "cmdecho")) (setvar "cmdecho" 0) (while (not (setq hat (entsel "\nSelect hatch: ")))) (setq elst (entget (car hat))) (if (= (cdr (assoc 0 elst)) "HATCH") (progn (setq rotn (* 180 (/ (cdr (assoc 52 elst)) pi)) hnam (cdr (assoc 2 elst)) hscl (cdr (assoc 41 elst)) )
;; The following nine lines may optionally be omitted. ;; Their purpose is to create a temporary "clone" of the ;; selected hatch with a 0 deg. rotation angle, in case ;; the hatch object specified a rotation angle. If these ;; lines are omitted, the current rotation of the selected ;; hatch will become the "0" deg. rotation for the extracted ;; pattern definition. (if (not (zerop rotn)) (progn (setq temp elst) (entmake temp) (command "_.rotate" (entlast) "" (cdr (assoc 10 temp))(- rotn)) (setq elst (entget (entlast))) (entdel (entlast)) ) ) ;; End of optional code.
(setq xofs (cdr (assoc 43 elst)) yofs (cdr (assoc 44 elst)) elst (member (assoc 53 elst) elst) ) (setq outf (strcat hnam ".pat")) (if (findfile outf) (progn (initget "Overwrite Append") (setq what (getkword (strcat "\n" outf " already exists; Overwrite/Append? "))) ) ) (setq outf (open outf (if (= what "Append") "a" "w")) flin (strcat "*" hnam) ) (foreach x elst (cond ((= (car x) 53) (write-line flin outf) (setq angl (cdr x) flin (trim (angtos angl 0 7)) ) ) ((= (car x) 43) (setq flin (strcat flin ", " (trim (rtos (/ (- (cdr x) xofs) hscl) 2 7)))) ) ((= (car x) 44) (setq flin (strcat flin "," (trim (rtos (/ (- (cdr x) yofs) hscl) 2 7)))) ) ((= (car x) 45) (setq tmp1 (cdr x)) ) ((= (car x) 46) (setq tmp2 (cdr x) xvec (/ (+ (* tmp1 (cos angl))(* tmp2 (sin angl))) hscl) yvec (/ (- (* tmp2 (cos angl))(* tmp1 (sin angl))) hscl) flin (strcat flin ", " (trim (rtos xvec 2 7)) "," (trim (rtos yvec 2 7))) ) ) ((= (car x) 49) (setq flin (strcat flin ", " (trim (rtos (/ (cdr x) hscl) 2 7)))) ) ((= (car x) 98) (write-line flin outf) ) (T nil) ) ) (write-line "" outf) (close outf) (alert (strcat hnam " pattern definition written to " hnam ".PAT")) ) (alert "Selected object not a HATCH.") ) (setvar "cmdecho" cmde) (princ) ) (defun trim (x / n) (setq n (strlen x)) (while (= (substr x n 1) "0") (setq n (1- n) x (substr x 1 n) ) ) (if (= (substr x n 1) ".") (setq x (substr x 1 (1- n))) ) x ) (alert (strcat "GETPAT.LSP (c) 2003 Tee Square Graphics\n" " Type GETPAT to start" ) ) (princ)
|
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 09 settembre 2009 : 08:33:17
|
Just PURGE - no question asked.
If you want to perform a PURGE in your drawing, without any interactive questions, you can use the commandline version of this command: -PURGE, or a simple LISP macro: Either add the following menu macro to your menu:
_-PURGE;_All;*;_N; Or add the the following LISP macro:
(vl-load-com)(vla-purgeall (vla-get-activedocument (vlax-get-acad-object)))
Or use LISP to define your own new command PURGEA: (defun C:PURGEA () (vl-load-com) (vla-purgeall (vla-get-activedocument (vlax-get-acad-object))) (prin1) ) |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 23 settembre 2009 : 13:10:18
|
Automatic drawing label - filename, date, author...
Using the text fields introduced back in AutoCAD 2005 you can easily create an automatic block to label your drawing with the information about its file name and path, last save date and author, and last plot date.
See an example - in your AutoCAD drawing enter the INSERT command, click the Browse button, press Alt+3 (Search Web) and in the lower address field enter the URL address http://www.xanadu.cz/dl/xstamp2005.dwg. Alternatively, use the commandline version of the command: _-INSERT http://www.xanadu.cz/dl/xstamp2005.dwg. This will insert a block containing predefined automatic text fields - these fields will be updated on any save and plot.
You can also try the Net_ID dynamic block. |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
GP
Utente Master
Regione: Piemonte
Prov.: Vercelli
2778 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
n/a
deleted
Prov.: Estero
Città: Sieradz (PL)
5926 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 30 settembre 2009 : 16:05:11
|
Citazione: Messaggio inserito da antoniovinci
Citazione: Messaggio inserito da arri
domande e risposte - suggerimenti vari
Un po' datati a dire il vero, ma un paio meritano...

ad esempio quella dell'inserimento field tramite lisp |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 08 ottobre 2009 : 13:33:40
|
Citazione: Messaggio inserito da antoniovinci
Citazione: Messaggio inserito da arri
domande e risposte - suggerimenti vari
Un po' datati a dire il vero,

sono sempre attuali per chi non conosce ancora FILEDIA  |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 09 ottobre 2009 : 10:19:04
|
scalare globalmente i testi mantenedo la posizione
You can use the SCALETEXT command and its options Existing (existing reference point) and Scale (relative scaling factor to make texts bigger or smaller).
Please note that the text created with the alignment Fit or Align will be also scaled, so their second alignment point will change. |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 21 ottobre 2009 : 12:40:15
|
Modified drawing name as an automatic field.
If you want to insert a text in your drawing (e.g. to the title block) which contains a manipulated name of the current drawing file - e.g. the filename left-trimmed or right-trimmed at a number of characters, you can use a combination of Diesel expressions in an automatic text field (e.g. with the FIELD command).
Some examples:
Drawing file name, no path, from the 3rd character (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGNAME),3,99) Drawing file name, no path, no extension (4 characters), right-trimmed at another 3 characters (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGNAME),1,$(-,$(strlen,$(getvar,DWGNAME)),7)) Beginning of the drawing path (12 characters), ellipsis, first 8 characters of the drawing file name (paste as a Diesel expression to a Diesel-type field):
$(substr,$(getvar,DWGPREFIX),1,12)...$(substr,$(getvar,DWGNAME),1,8) |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 21 ottobre 2009 : 13:09:25
|
Total length of lines in a drawing (by layer).
With the free LISP utility Xanadu AddLen you can summarize the total length of all selected lines, arcs, polylines and other curves in your current drawing.
The lengths are also grouped by layers. You can optionally export the results to a SDF text file.
Sample output: Layer-Length: 0 118.1143 POWER 438.91 PHONE 311.08 LAN 3010.72
AddLen Run it with the AddLen command. |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 30 ottobre 2009 : 11:16:10
|
Section modulus of 2D profiles in AutoCAD.
The MASSPROP command does not display the value of the section modulus of the selected object.
To calculate the section modulus Wx/Wy (SMx/SMy) of simpler 2D profiles in AutoCAD you can use the LISP utility Xanadu Modulus.
Its MODULUS command prompts for selection of a closed polyline or a region and calculates the section modulus to the centroid of the geometry. The resulting values Wx and Wy can be inserted into the drawing as a text.
The values are calculated from the moments of inertia and they are relevant only for simpler geometric shapes.
You can download the free Modulus application
You can preset the multiplication factor for displayed results: (setq modKoef 0.001)
You can preset the suffix for displayed results: (setq modSuf " cm^3") |
 |
|
arri
Utente Master
Regione: Lombardia
14951 Messaggi |
Inserito il - 30 ottobre 2009 : 11:33:02
|
How to insert the surface symbol (roughness)? The symbol for surface roughness and machining parameters is included in the mechanical version of AutoCAD - AutoCADu Mechanical. See the AMSURFSYM command (ribbon Annotations).
To draw the surface symbol in a plain AutoCAD or AutoCAD LT you can use the dynamic block Roughness from the CAD Blocks library. It conforms to the ISO 1302 standard. Insert the block in the standard way, select the type of symbol (visibility state) and double-click the symbol to enter the requested descriptions (attributes). |
 |
|
Discussione  |
|