CAD PANACEA HAS MOVED TO http://cadpanacea.com
29 August 2007
Per viewport layer control          
Starting in AutoCAD 2008, you can now control more layer properties on a per viewport basis. You could always freeze layers per viewport, but now you can change color, linetype, lineweight, and plot style. Now the same line can be red with the hidden linetype in one viewport and green with a continuous linetype in another viewport.




These additional layer properties add several columns to the layer dialog. You can hide unused columns easily by right-clicking on any column and unchecking the ones you want to hide.

Labels: ,


PermaLink       Posted 8/29/2007 10:03:00 PM      Comments (0)
17 August 2007
Last months poll          

PermaLink       Posted 8/17/2007 07:47:00 AM      Comments (0)
Adding Autodesk KB Search to FireFox          
Firefox includes a search bar that allows you to search frequently accessed sites such as Google, Amazon, Wikipedia, etc.



You can add more search sites by visiting this page. However, what if you want to add a site that is not listed there?

Download this Firefox plugin (Add to Search Bar), then go to your favorite Autodesk KB search site (AutoCAD, Land Desktop, ABS, etc), and right click in the search box and choose "Add to Search Bar".

If you find a search site on which this plug in does not work, it's still possible to manually add a search site. More details here.




Labels: , ,


PermaLink       Posted 8/17/2007 06:55:00 AM      Comments (0)
13 August 2007
Create a TABLE using lisp          
Here is an example of creating a TABLE entity using lisp. This example also creates some FIELDS using lisp.

This routine allows the user to select closed polylines, and it will create a TABLE with two columns. One containing the area, and the other containing the ObjectID. The last row totals up the area. You could easily adapt this to show the layer, color or any other property.

The TABLE is creating on the current tablestyle, so depending on the settings of your current tablestyle, you may have to adjust the sizing arguments in the (vla-addTable...) function in order for the table to look acceptable. These sizes used here work with the Standard tablestyle in a new empty drawing.


; load (vl-load-com) first
(vl-load-com)
(defun C:POLYTABLE ( / *MS* A CNT I LST MYTABLE PT1 ROW SSET TLST)

; create an empty list, set a counter variable, and
; set a reference to the current model space.

(setq lst '()
i 0
*ms* (vla-get-modelspace
(vla-get-activedocument
(vlax-get-acad-object)))
)
; prompt the user to select closed polylines
(princ "\n Select closed polylines ")
(if (setq sset (ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "&")(70 . 1))))
; if a valid selection set was generated, then proceed.
(progn

; for each closed polyline selected, grab the ObjectID and Area
; and store these values in a list.

(repeat (setq cnt (sslength sset))
(setq a (vlax-ename->vla-object (ssname sset i)))
(setq tlst (list (vla-get-Area a) (vla-get-ObjectID a)))
(setq lst (cons tlst lst))
(setq i (1+ i))
)
; pick a point for the table
(setq pt1 (getpoint "\nPick point for table "))
; add the new table
(setq myTable (vla-AddTable
*ms*
(vlax-3d-point pt1)
(+ 3 cnt)
2
0.7
2.5))
; the next three lines set the header text
(vla-setText mytable 0 0 "Polyline Table")
(vla-setText mytable 1 0 "Area")
(vla-setText mytable 1 1 "Object ID")
(setq row 2)

; loop through the list of polyline properties
; adding a line to the table that contains the
; area and the ObjectID

(foreach item lst
(vla-setText mytable
row
0
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (last item))
">%).Area \\f \"%lu2\">%"))
(vla-setText mytable row 1 (last item))
(setq row (1+ row))
)
; On the last row, total up the area
(vla-setText mytable
row
0
(strcat "Total=\\P"
"%<\\AcExpr (Sum(A3:A" (itoa (+ 2 cnt)) ")) \\f \"%lu2\">%"))
; release "myTable" and *ms*
(vlax-release-object myTable)
(vlax-release-object *ms*)
); end progn

; if no closed polylines were selected,
; end the program with this message

(princ "\nNo closed polylines selected. ")
); end if
(princ)
); end defun




Labels: ,


PermaLink       Posted 8/13/2007 07:44:00 AM      Comments (0)