Tags
29 Monday Dec 2014
Posted Protect
inTags
28 Sunday Dec 2014
Posted Counting
inTags
28 Sunday Dec 2014
Posted Coordinates
in28 Sunday Dec 2014
Posted Blocks
inTags
;;;NOMBRE ARCHIVO : BlockstoTable ;;;DESCRIPCION : Esta rutina Selectiona los bloques por medio de una seleccion en pantalla o bien Total los bloques ;;; en el espacio Modelo o Papel, para despues contarlos y crear una tabla con el bloque, su nombre y el numero de veces ;;; que esta presente en la seleccion ;;;AUTOR : Marco Antonio Jacinto Perez ;;;FECHA : Noviembre de 2005 ;;;----------------------------------------------------------------------------- ;;;BLOCKTOTABLE function ;;;Mcommands 2006, Guadalajara, Jalisco Mexico ;;;By Marco Antonio Jacinto Perez ;;;email:mcoan001@hotmail.com ;;;----------------------------------------------------------------------------- ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun AddTextStyle (TxtStyleName Font doc / *Textstyles* NewStyle) (and (setq *Textstyles*(vla-get-TextStyles doc)) (not(collection-item-p *Textstyles* TxtStyleName)) (setq NewStyle(vla-add *Textstyles* TxtStyleName)) (vla-setFont NewStyle Font :vlax-false :vlax-false 0 0) ) NewStyle ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun for-sset (sset f / n) (if(= 'PICKSET(type sset)) (repeat (progn(setq n -1)(sslength sset)) (f(ssname sset(setq n(1+ n)))) ) ) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun collection-item-p (collection Item) (cond ((vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list Collection Item) ) ) nil ) (t(vla-item Collection Item)) ) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun list->variantArray (ptsList / arraySpace sArray) (setq arraySpace(vlax-make-safearray vlax-vbdouble;elemento tipo (cons 0(-(length ptsList)1));_ array dimension ) ) (setq sArray(vlax-safearray-fill arraySpace ptsList)) (vlax-make-variant sArray) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun NameUnnamedUcs (*adoc* UcsName / *UCS* Origin XAxisPoint YAxisPoint) (if(=(getvar"WORLDUCS")0);If UCS Difers from world then (progn (Setq *UCS*(vla-get-UserCoordinateSystems *adoc*) Origin(getvar "UCSORG") XAxisPoint(mapcar '(lambda(pt1 pt2)(+ pt1 pt2)) Origin (getvar "UCSXDIR") ) YAxisPoint(mapcar '(lambda(pt1 pt2)(+ pt1 pt2)) Origin (getvar"UCSyDIR") ) ) (vla-add *Ucs*(list->variantArray Origin) (list->variantArray XAxisPoint) (list->variantArray YAxisPoint) UcsName ) ) ) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun GetBlocks (space /) (cond ((=(Type Space)'STR)(vlax-for obj(vla-get-block(vla-item *layouts* space))(bkobj obj))) ((=(Type Space)'PICKSET) (for-sset Space (lambda(ename / obj) (setq obj (vlax-ename->vla-object ename)) (bkobj obj) ) ) ) ) BkCountLst ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (defun bkObj (obj / BkName) (cond ((/= (vla-get-ObjectName obj) "AcDbBlockReference")) ((and (setq BkName (vla-get-Name obj)) (assoc BkName BkCountLst) ) (setq BkCountLst (subst (cons BkName (1+ (cdr (assoc BkName BkCountLst)))) (assoc BkName BkCountLst) BkCountLst ) ) ) (T (setq BkCountLst (cons (cons BkName 1) BkCountLst) ) ) ) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (Defun c:BTL (/ *acad* *adoc* *Layouts* BkCountLst SpaceBkCt ptt *tabla* Table1 *BLOCKS* CTROW ROW *TABLESTYLE* CTC COL_CT LayName NwUcs ss) (setq *acad* (vlax-get-acad-object) *adoc* (vla-get-activedocument *acad*) *Layouts* (vla-get-Layouts *adoc*) *blocks* (vla-get-Blocks *adoc*) ) (vla-startundomark *adoc*) (or (setq NwUcs (collection-item-p (vla-get-UserCoordinateSystems *adoc*) "BTUcs"))) (initget "Selection ModelSpace PaperSpace Total") (setq SpaceBkCt (GetKword "\n Count Blocks in [/ModelSpace/PaperSpace/Total]" ) ) (cond ((or (= SpaceBkCt "Selection") (= SpaceBkCt nil)) (setq SpaceBkCt "Selection") (while (null ss) (setq ss (ssget '((0 . "INSERT")))) ) (princ "\n Getting Blocks in Selection...") (GetBlocks ss) ) ((= SpaceBkCt "ModelSpace") (setq SpaceBkCt "Model Space") (princ "\n Getting Blocks in ModelSpace...") (GetBlocks "Model") ) ((= SpaceBkCt "PaperSpace") (initget "All Type Current") (setq GetPs (GetKword "\n Count Blocks in [/Type Name/All] layouts: " ) ) ;;; ---------- (cond ((or (= GetPs nil) (= GetPs "Current")) (princ "\n Getting Blocks in Current Layout...") (GetBlocks (getvar "ctab")) (setq SpaceBkCt "Paper Space") ) ((= GetPs "All") (princ "\n Getting Blocks in all Layouts...") (setq Layouts (layoutlist)) (foreach lay layouts (GetBlocks lay) ) (setq SpaceBkCt "all Layouts") ) (t (while (not (member LayName (mapcar 'strcase (layoutlist)))) (setq LayName (strcase (getString "\n Type layout name: " T))) ) (mapcar 'princ (list "\n Getting Blocks in Layout " LayName "...") ) (GetBlocks LayName) (setq SpaceBkCt (strcat "Layout " LayName)) ) ) ;;; ------------ ) (t (princ "\n Getting Blocks in Paper and Model Space...") (setq Layouts (cons "Model" (layoutlist))) (foreach lay layouts (GetBlocks lay) ) ) ) (if BkCountLst (progn (setq BkCountLst (vl-sort BkCountLst (function (lambda (e1 e2) (< (car e1) (car e2)) ) ) ) ) (princ "Done") (cond ((collection-item-p (vla-get-dictionaries *adoc*) "TablaBlocks" ) ) (T (AddTextStyle "Anot_Arial" "ARIAL" *adoc*) (setq *tableStyle* (vla-item (vla-get-dictionaries *adoc*) "acad_tablestyle" ) *tabla* (vla-addObject *tableStyle* "TablaBlocks" "AcDbTableStyle" ) ) (vla-SetTextHeight *tabla* acTitleRow 5.0);altura texto rotulo principal (vla-SetTextHeight *tabla* acHeaderRow 3.5);altura texto rotulo bloques (vla-SetTextHeight *tabla* acDataRow 3.5);altura texto bloques (vla-SetTextStyle *tabla* acHeaderRow "Anot_Arial") (vla-SetTextStyle *tabla* acTitleRow "Anot_Arial") (vla-SetTextStyle *tabla* acDataRow "Anot_Arial") (vla-put-Vertcellmargin *tabla* 3.5) (vla-put-Horzcellmargin *tabla* 10.0) ) ) (or ptt (setq ptt ;(trans (getPoint "\nSelect insertion point of Tasble: " ) ;;; 1 ;;; 0 ;;; ) ) ) (progn (princ "\n Creating Table, please wait... ") (setq Ptt (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 2) ) ptt ) ) Table1 (vla-addTable (vla-get-ModelSpace *adoc* ) ptt 2 3 0.2 2.0 ) ctc 0 ) (vla-put-StyleName Table1 "TablaBlocks") (vla-setText Table1 0 0 (strcase (strcat "Blocks in " (if (= SpaceBkCt "Total") "Drawing" SpaceBkCt ) ) ) ) (vla-setText Table1 1 0 "Picture") (vla-setText Table1 1 1 "Block Name") (vla-setText Table1 1 2 "Count") (vla-setcolumnwidth Table1 0 40.0);anchura columna bloque (vla-setcolumnwidth Table1 1 100.0);anchura columna nombre (vla-setcolumnwidth Table1 2 33.0);anchura columna cantidad (vla-setRowHeight Table1 0 5) (vla-setrowHeight Table1 1 3.5) (if (setq NwUcs (NameUnnamedUcs *adoc* "BTUcs")) (progn (setq TransMatrix (vla-getUcsMatrix NwUcs)) (vla-TransformBy Table1 TransMatrix) ) ) ) (setq row 2) (foreach BksLst BkCountLst (vla-insertrows Table1 row 0.35 1) (setq Col_ct 0) (vla-SetCellType Table1 row Col_ct acBlockCell) (vla-SetBlockTableRecordId Table1 row Col_ct (vla-get-ObjectID (vla-item *blocks* (car BksLst))) :vlax-true ) (setq col_ct (1+ Col_Ct) ) (vla-SetText Table1 (vlax-make-Variant row vlax-vbLong) Col_ct (vlax-Make-Variant (strcase (car BksLst)) Vlax-VbString) ) (setq col_ct (1+ Col_Ct) ) (vla-SetText Table1 (vlax-make-Variant row vlax-vbLong) Col_ct (vlax-Make-Variant (cdr BksLst) Vlax-VbString) ) (setq row (1+ row) ) ) (setq ctrow 2) (repeat (- (vla-get-rows table1) 2) (vla-setcellalignment Table1 ctrow 1 acmiddleleft) (setq ctrow (1+ ctrow)) ) (princ "Done") ) (mapcar 'princ (list "\n There are not blocks references in " SpaceBkCt "." ) ) ) (vla-endundomark *adoc*) (prin1) ) ;;;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ (c:btl)
23 Tuesday Dec 2014
Posted Protect, Tips (English)
in1. In order to decompile Visual Lisp (VLX,FAS) files use following decompilers:
Visual Lisp:
In order to decompile Visual Basic v5/v6 files use following decompilers:
Visual Basic v5/v6:
In the case of the disappearance of all of these files copies placed here:
https://onedrive.live.com/?cid=2fff32951ecee9ac&id=2FFF32951ECEE9AC%2121452
23 Tuesday Dec 2014
Posted Text
in23 Tuesday Dec 2014
Posted Tips (English)
inColor-dependent plot style tables use an object’s color to determine characteristics such as lineweight. Every red object in a drawing is plotted the same way. While you can edit plot styles in a color-dependent plot style table, you cannot add or delete plot styles. There are 256 plot styles in a color-dependent plot style table, one for each color.
Named plot style tables contain user-defined plot styles. When you use a named plot style table, objects that have the same color may be plotted differently, based on the plot style assigned to the object. A named plot style table can contain as many or as few plot styles as required. Named plot styles can be assigned to objects or layers, just like any other property.
You can use the Plot Style Manager to add, delete, rename, copy, and edit plot style tables. Both color-dependent and named plot style tables are stored in the Plot Styles folder by default.
In case of plotting of AutoCAD drawing it is important setting that drawing will be plotted by COLOR settings (CTB – Color Table) or you can set different linetypes by NAMED PLOT STYLES.
A drawing has already been defined during its creation – by selecting template drawing – if it uses CTB or STB plotting. Setting of Default type is on the Plot and Publish tab of the Options panel. Here is where you can set if the future drawings have CTB or STB settings.
If you get a drawing that requires STB extension file, and you don’t have it but you would like to plot this drawing by colors. The solution is the CONVERTPSTYLES command. Using it the drawing can be converted from STB mode into CTB mode.
Pay attention that in this case the command – if you start it in CTB mode – will work in reverse mode. It means that you convert the drawing from CTB mode into STB mode.
23 Tuesday Dec 2014
Posted Tips (English)
inPart of the engineering structures have fixed geographic location, and this geographical position is the defined characteristics of the object, as well.
Using AutoCAD 2014 and Autodesk 360 application live geographic reference, data (Live Map data) can be connected to our drawings. Since the identification of the geographical position is made using the coordinate system, AutoCAD 2014 includes most of the coordinate systems used worldwide. The library of the coordinate system is the same as the library of AutoCAD Map 3D library. It is a very useful function not only for cartographers but also for those who design buildings.
You can assign Geographic Location information to a drawing file. Inserting geographic information to a drawing mixed points within the drawing correspond to actual geographic locations on the surface of the Earth.
You do this by placing geographic marker within the drawing. To set the geographic location in the drawing on the Insert ribbon in the Location panel, expand the Set Location tool.
If you already have a file that contains GIS data you can choose the From File tool, and then open a KML or KMZ file.
To set the geographic location by specifying the Latitude and Longitude or to set the location from a map, choose the From Map tool.
The program asks: Do you want to use Live Map Data? Click: Yes.
In order to use Live Map Data you must be signed into your Autodesk 360 account. Since you have not yet signed into your Autodesk 360 account, the program displays an Autodesk Sign in dialogue, where you can sign in your Autodesk 360 account. If you do not have this account, you can create one by clicking on the Need Autodesk ID dialogue.
When you sign into your Autodesk 360 account the program displays the Geographic Location dialogue. Initially this dialogue shows the entire world. You could click to specify a location on the map but it’s much easier to search for an address, or a Latitude and Longitude. In this case type in a place and press Enter. Notice that multiple results are found. When you start typing a place all kinds of possibility concerning this place will appear in a list and you can choose the right one from it. The map immediately updates and notices that you can display the map as either Road or Aerial data.
NOTE: If the map doesn’t update, use the Zoom in or the Zoom out icons.
You can also enter an actual address. Type the actual address and press Enter. The map zeros into the location you specified. Now that you found the correct location you click Drop Marker Here. Appearance placed on the map and the corresponding Latitude, Longitude and Time Zone are automatically applied.
Then you can zoom into the map and move the Pin or modify the location properties as needed. But it’s even easier to Right-Click and choose the Move Marker Here. Then you move the Pin to the right place on the map, e. g.: at one of the corner of the building.
Notice that at present the Elevation is zero. You can click on the icon to the right of the Elevation to unlock the Latitude, Longitude and Elevation fields so that those values can be edited. You can change the Elevation and then click the check mark to save the changes.
Note that the current drawing unit is automatically displayed in the Geographic Location dialog or you can choose from a list of standard units.
The inserted map is automatically scaled appropriately for the specified drawing units.
Note that the program assigns WORLD MERCATOR as the default Coordinate System. You can also expand the GIS Coordinate System dropdown and choose from a library of coordinate systems. This is important since the coordinate system defines the scale of the map.
Choose one and then click Continue. The program prompts you to select a point for the location. Click on the corresponding point in your drawings. Next the program prompts you to specify the north direction or you could specify an angle.
As soon as you do that the command ends and you can see the map image as a background within your drawing. When a map is applied to a drawing it is always displayed below the drawing geometry. Now that you have applied a geographic location a Geolocation Marker displayed in the drawing at the point you specified and a new Geolocation tab is added to the Ribbon.
This tab includes tools for modifying the Geolocation and map display.
Under the drawing windows, in the status line two icons appear. Using one of these you can turn on or off the Geographic Marker Visibility, the other shows the actual GIS Coordinate System.
23 Tuesday Dec 2014
Posted Tips (English)
inThe AutoCAD SDI (Single Document Interface) system variable gives you the possibility of open more than one drawings at the same time.
Attila G. Horvath February 16, 2013
From the beginning of AutoCAD 2000 version, Autodesk makes the possibility of more than one drawings be opened with AutoCAD at the same time. They created a system variable to regulate it. This is SDI (Single Document Interface), which regulates to open only one or more drawings at the same time.
Why was it important?
In the old days not everybody had a strong computer, and it was not possible to open more drawings at the same time, or to handle them without problems. Although the base setting was to open more drawings at the same time, with this system variable it could be changed to single drawing compatibility. It means that if you open a new drawing, all the earlier opened drawings will be closed.
This setting possibility was available in AutoCAD at Settings panel System tab till the 2007 version.
Then there was a description also in the Help of the program. All imprints are disappeared from Help and Settings, as Autodesk mentioned it after SDI system variable specification. From this independently if we type it in the command line, the program will recognize it and we can set it.
Sometimes it happens that it is retooled, so I give you the settings of the AutoCAD SDI system variable.
It limits the program to open only one drawing at once. If you delete this option, you can open more drawings at once. If few drawings are opened you can not turn on this option until you close additional drawings. (SDI system variable)
Type: whole
Saved: system database
Started value: 0
It regulates that program runs with one or more interfaces.
0 – Turn on multidocument interface.
1 – Turn off multidocument interface.
2 – (Read only) Multidocument interface was denied because such an application was downloaded which did not support multidocument interface. Two values of SDI variable are not saved.
3 – (Read only) Multidocument interface was denied because user changed SDI variable to 1 and downloaded such an application which did not support multidocument interface. (SDI variable was changed to 1 before downloading.) Value 3 of SDI variable is not saved.
If SDI value is changed to 3, it will be changed to 1, when application which does not support other drawings is deleted from memory.
Remark: SDI system variable will be removed from future version of AutoCAD. Now SDI works but it is not supported. Some commands and function do not work when you use single document interface.
23 Tuesday Dec 2014
Posted Tips (English)
in