Search the Community
Showing results for tags 'property'.
Found 5 results
Assign Integer/Double value to Dynamic Block Custom Property
JonHilll posted a topic in AutoLISP, Visual LISP & DCLI am trying to link the actual value of the length property of a polyline with a custom property I've created in a dynamic block. Basically, I would like to be able to link the property line length with a call out block that contains the line's length as "Count" property (Dbl). I've created a custom property to hold the numeric value (i believe this should be a Double value in order to sum values in table?) so I can then sum all lengths of similar call out blocks in a table. The reason I am using a custom property is so I can specify it as a Double value so the values will be able to sum up in the table. Using fields, I can link the poly line length to an attribute field but this becomes a string object which I can't add together in the table, as far as I understand anyway. What changes would I need to make to Lee Mac's awesome Lisp routines (huge fan of yours, Lee) to add this feature? I've attached the lisp file with the sub routines that seem useful for this task included, but I have quite a bit of trouble putting it all together. I've reverted all of Lee's subroutines back to the original code so none of my customization causes any errors. My end game is simple: Select the poly line(s), select the dynamic block to be associated with said line(s), and then populate the custom "Count" property with the length of the selected poly line(s) as a Double value. This will allow me to summarize the total length using data extraction and a table. Any help with this would be greatly appreciated, and please include the why & how if you have the time so I can learn and share with others You guys are the best, thanks in advance! Count.lsp PROP_CO_1.dwg
help combine 2 lisp into 1
James281 posted a topic in AutoLISP, Visual LISP & DCLI have 2 lisp routines help draw bearing line and label them but i would have to do 2 command seperately so i am seeking someone help me combine them together. command 1 is to draw the bearing... ;Tip1741: BD.LSP Bearing/Distance lines (c)2001, Joon Hong $50 Bonus Winner (defun C:BD () (setvar "cmdecho" 0) (initget 1) (setq PT (getpoint "\nPick a starting point: ")) (initget 1 "NE NW SE SW") (setq BR (getkword "\nPick bearing (NE/NW/SE/SW): ")) (setq OPT (strcase BR)) (initget 1) (setq LEN (getreal "\nType the length: ")) (setq DEG (getstring "\nType the degree: ") minx (getstring "\nType the minute: ") SEC (getstring "\nType the second: ")) (if (= DEG "") (setq DEG "0")) (if (= minx "") (setq minx "0")) (if (= SEC "") (setq SEC "0")) (cond ((= "SW" OPT) (setvar "angbase" (cvunit 270 "degree" "radian")) (setvar "angdir" 1)) ((= "SE" OPT) (setvar "angbase" (cvunit 270 "degree" "radian")) (setvar "angdir" 0)) ((= "NW" OPT) (setvar "angbase" (cvunit 90 "degree" "radian")) (setvar "angdir" 0)) ((= "NE" OPT) (setvar "angbase" (cvunit 90 "degree" "radian")) (setvar "angdir" 1))) (command "line" PT (strcat "@" (rtos LEN) "<" DEG "d" minx "'" SEC "\"") "") (setvar "angbase" 0) (setvar "angdir" 0) (setvar "cmdecho" 1) (princ)) (princ "\nType 'BD' to draw lines with bearings") (princ) command 2 is to label the bearing line ; TIP752.LSP Distance and Bearing (c)1992, Roy Cook ;* distance and bearing label for lines (graphscr) (prompt "\nloading. . .") ;convert radians to degrees (defun rtd (R) (/ (* R 180.0) pi)) (defun C:brg2 () ;input for line notations (setq P1 (getpoint "\nfirst point: ")) (while (setq P2 (getpoint p1 "\nsecond point: ")) (setq T1 "text height: <default = " T2 ">: " T3 (getvar "textsize") );setq (terpri) (setq TH (getreal (strcat T1 (rtos T3 2 2) T2))) (if (= TH nil) (setq TH t3)) ;determine if bearings are true north, south, east, or west (defun nsew () (if (and (= (car P1) (car P2)) (< (cadr P1) (cadr P2))) (setq BNG "north") );if (if (and (< (car P1) (car P2)) (= (cadr P1) (cadr P2))) (setq BNG "east") );if (if (and (= (car P1) (car P2)) (> (cadr P1) (cadr P2))) (setq BNG "south") );if (if (and (> (car P1) (car P2)) (= (cadr P1) (cadr P2))) (setq BNG "west") );if );defun ;place text on line (setq AA (angle P1 P2) DS (distance P1 P2) P3 (polar P1 AA (/ DS 2.0)) AA1 (strcat (rtos (/ DS 12.0) 2 2) "'") );setq ;calculate bearing from coordinates and format for printing (defun bearing () (setq O (- (car P2) (car P1)) T (- (cadr P2) (cadr P1)) AZMTH (/ (* (atan (/ O T)) 180.0) pi) A (abs AZMTH) D (fix A) M (* 60 (- A D)) S (* 60 (- M (fix M))) M (fix M) );setq (if (= "60" (rtos s 2 0)) (setq M (+ 1 m))) (if (= "60" (rtos s 2 0)) (setq S 0)) (if (= "60" (rtos m 2 0)) (setq D (+ 1 d))) (if (= "60" (rtos m 2 0)) (setq M 0)) (if (< (cadr P2) (cadr P1)) (setq G "s") (setq G "n")) (if (< (car P1) (car P2)) (setq H "e") (setq H "w")) (setq BNG (strcat G "" (if (< D 10) (strcat "0" (rtos D 2 0)) (rtos D 2 0)) "%%d" (if (< M 10) (strcat "0" (rtos M 2 0)) (rtos M 2 0)) "'" (if (< S 10) (strcat "0" (rtos S 2 0)) (rtos S 2 0)) "''" "" H)) );setq ;bearing and distance on line (if (or (= 0 (- (car P1) (car P2))) (= 0 (- (cadr P1) (cadr P2)))) (nsew) (bearing)) (command "text" "m" (polar P3 (rem (+ AA (/ pi 2)) (* pi 2.0)) TH) TH (rtd AA) AA1) (if (or (> (car P1) (car P2)) (= (rtd AA) 270)) (command "rotate" "last" "" P3 180.0) );if (command "text" "m" (polar P3 (rem (+ AA (* pi 1.5)) (* pi 2.0)) TH) TH (rtd AA) BNG) (if (or (> (car P1) (car P2)) (= BNG "south")) (command "rotate" "last" "" P3 180.0) );if (command "line" P1 P2 "") (setq P1 P2) ) (princ);end program cleanly );defun thank you in advance
Layer Filter Properties
Ahankhah posted a topic in AutoLISP, Visual LISP & DCLHi all, is there a way to define a property filter for lyers to exclude some patterns? (Assume you want to hide layers starting with "3D ", which the matching pattern in wcmatch function is "~3D *"...) Any help is appreciated.
vb.net Get properties of a custom AutoCAD object
TT2 posted a topic in .NET, ObjectARX & VBASolution found.
Updating Property in Objects Definition in XREF DWGs
zetazee posted a topic in .NET, ObjectARX & VBAHi, I am developing an simulation application, leveraging on using Space objects and applied additional Property Set Definitions for Space objects where I introduced a new Property "Value". I applied a display theme to my DWG, and based on the value of the Property, different colours wil be displayed according to the display theme. For a single DWG file containing the building, I am able to simulate the colour changes by updating the “Value” Property in the Spaces using .NET APIs functions such as PropertySet.SetAt, and commiting the transasction. However, one building can consist of many different levels, and I have split up the modeling of the building into its separate levels. For example, a 3 storey building, I will have 3 DWG files for each individual levels. A main empty DWG was then used to XREF the 3 levels, to combine the different levels into a whole building. I would like to simulate such colour change through the main DWG which references my individual level DWGs. Any idea what .NET API I can use to access the XREF DWGs in my main DWG, so that I can update the "Value" property in all my Space objects?