Search the Community
Showing results for tags 'extract'.
-
Hello guys, would like to ask for your help that I'd like to have a lisp that can let me extract data from multiple lines which then the data can be exported into a txt file. Would like to export the angle of the line ( the angle extracted should be in the form of degree minute second), the distance and also the end point coordinate( Y & X) in this order. Thank you very much. I am struggling with this problem!
-
Dear Members! Problem part I I now turn to you with the question of how to extract certain data from the "_massprop" command and assign it to a variable immediately. I am working on an automation task where a cable cross section has to be pulled out on a given 3D polilyne path. I need to extract the volume of the resulting 3D solid to calculate the volume of the displaced top. Problem part II Similarly, I should extract the length of the extracted 3D tube from the property table. This data is available if I extract the cross section with the _extrude / path command. I have to assign the extracted data to a variable within the lisp program to perform a mathematical operation on it. As follows: (setq V (volume data from the _massprop command)) (setq Vm (/ V (1000 ^ 3)); converting the mm3 to m3 Problem part III I would like to write the obtained result in a table in the model space. Column 1: "Volume of ground displaced by the pipeline" Colum 2: "The result of the calculation (which will be the value of a variable Vm)" Here is my code for calculation the cross section of the cable and to extrude it. The polyline must to be placet at '(0 0 0) All help comes in handy: (defun c:kabel(/ K_A K_AKEM K_DKE K_DKEM K_H K_L K_PT0 K_PT1 K_PT2 K_PT3 K_PT4 K_PT5 K_RKE K_RKEM K_RTOT K_SS1 K_V PIR) (setq K_Dke (getreal "Adja meg a kábel ér külső átmérőjét:")); Give me the diameter of the subcable (setq K_Akem (getreal "Adja meg a kábel ér magjának keresztmetszet területét (mm2)-ben) :")); Give me the copper cross section area (setq K_L (getreal "Adja meg a beillesztett polilyne teljes hossszát m-ben:")); Give me the length of the cable route (setq pir 3.141592654) (setq K_Dkem (sqrt (/ (* K_Akem 4) pir))); The copper diameter (setq K_Rke (/ K_Dke 2)) (setq K_Rkem (/ K_Dkem 2)) (setq K_pt0 '(0 0 0)) ; The low right cable part (you have 3 of them) (setq K_pt1 (polar K_pt0 (* pi 0.666666666666) K_Dke )); The center position of the upper cable part (setq K_pt2 (polar K_pt0 pi K_Dke)); The center of the third cable part ( part 3 of 3) (setq K_h (* K_Dke (sin (/ pi 3)))) (setq K_pt3 (polar K_pt2 0 (/ K_Dke 2))) (setq K_pt4 (polar K_pt3 (/ pi 2) (* K_h 0.333333333333)));The outer circle center point calculated from 3 cabel parts which are 120 degree from each other, like a mercedes logo (setq K_Rtot (+ K_Rke (* K_h 0.666666666666666))); Radius of the cable pipe (setq K_pt5 (polar K_pt4 (/ pi 2) K_Rtot)) (command "_circle" K_pt4 K_Rtot "") (setq K_ss1 (ssget "_L")) (command "_extrude" "_Mode" "_solid" K_ss1 "" "_path" '(0 0 -0.1) "") (setq K_A (* (* (/ K_Rtot 1000) (/ K_Rtot 1000)) pir)) (setq K_V (* K_A K_L)) (alert (strcat "The volume of the cable=" (rtos K_V) "m3")) (princ) )
-
This is probably not the right way to ask this question, but here goes. I am using Microvellum with AutoCad 18 OEM version, so I don't have all the express tools and other goodies. I have a lot of AC tools though and what I am wanting to do is take a 3D drawing of a base cabinet and take away part of the side, so as to see inside the cabinet and still see the entire product in an Iso metric view for our catalog. I am sure this is a simple procedure, I have been all over the forums and have tried all I can think of off the top of my head. I can draw section views and all that with no problem, but those are only in 2D. My boss wants an isometric view with part of the side cut out, so that you see inside and can still see the machining for shelves and see the drawer boxes in there. I know it can be done, just not sure best way to go about it. I will try to post a picture or dwg. of this cabinet as soon as I can. thank you in advance for any insight on this matter.
-
I had this from Lee, but usually always go way counter-clockwise and only select the polyline, not the point. ;; Polyline Vertex Exporter ~ by Lee McDonnell ~ 26.11.2009 (defun c:pExp2 (/ ss tmp i j ent tot dis pt) (vl-load-com) (if (and (setq ss (ssget '((0 . "*POLYLINE")))) (setq tmp (getfiled "Output File" (cond (*load) ("")) "txt;csv" 9))) (progn (setq *load tmp tmp (open tmp "a") i -1) (write-line "X,Y,Layer" tmp) (while (setq ent (ssname ss (setq i (1+ i)))) (setq tot 0. j (1- (vlax-curve-getStartParam ent))) (while ( (setq pt (mapcar 'rtos (vlax-curve-getPointatParam ent j))) (write-line (strcat (car pt) (chr 44) (cadr pt) (chr 44) (vla-get-layer (vlax-ename->vla-object ent))) tmp)) (write-line "" tmp)) (close tmp))) (princ)) THX for any tips.
-
VBA Data Extraction to Excel-Sheet (DATAEXTRACTION; EATTEXT)
vjdazam posted a topic in .NET, ObjectARX & VBA
Hi, I need to extract Information ("General": Color, etc. and "Geometry": Length, Start Y, End X, etc.") from AutoCAD to an Excel-Sheet using VBA. First I've tried it manually in AutoCAD with the commands DATAEXTRACTION and EATTTEXT and it works. Also I've tried entering in VBA "SendCommand ("DATAEXTRACTION" & vbCr")", then an AutoCAD-window is opened and I have to click on "Next" several times and to specify the folder where I want to save the file. I want that VBA does all this process without the window appearing (I mean "without clicking on "Next" several times and specifying the file path"). Obvious the User has to Input into the code the location where he wants to save the file with the extracted information). Instructions als "For Each Object in ModelSpace: Line.StartPoint, Line.Color, etc." don't help me unfortunately because this way slow down the VBA-program. May anyone help me? Thanks! Regards, -
hi, I have a little problem with a lisp file that extract coordinates from DWG and label them with prefix and counters then export them to text file. if anybody can advice how to exit this lisp correctly i would really appreciate it a lot. (defun run () (setq pll (getstring "\nPlease Enter of new file (name.ext) :")) (setq pl (open pll "w")) (setq ang ( getreal "\nPlease Enter DV Angle: " ) ) (setq n ( getstring "\nPlease Enter TAXI name: " ) ) (initget (+ 1 2 4)) (setq a ( getint "\nPlease Enter MH number: " ) ) ;(setq e (getstring "\nget no. of first Point :")) ;(setq a (atoi e)) (while (> a 0) (setq aa 1) (while (<= aa 4) (setq p (getpoint "\nselect point :")) (setq v1 (strcat "\n " (itoa a) " " (itoa aa) " ")) (setq d (polar p (dtr 90) 0)) (setq f (itoa aa)) (setq k (itoa a)) (setq g (strcat n "-" k "-P-" f)) (command "layer" "m" "number" "c" "3" "" "") (command "text" "m" d 0.2 ang g) (setq num (entlast)) ;(command "change" num "" "layer" "" number "") (command "change" num "" "p" "layer" "number" "") (command "layer" "m" "point" "c" "1" "" "") (command "point" p) (setq pt (entlast)) ;(command "change" pt "" layer "" point "") (command "change" pt "" "p" "layer" "point" "") (setq x (car p)) (setq x (rtos x 2 4)) (setq x (strcat x " ")) (setq v2 x) (setq y (cadr p)) (setq y (rtos y 2 4)) (setq y (strcat y " ")) (setq v3 y) (princ V1 pl) (princ v2 pl) (princ v3 pl) (setq aa (+ aa 1)) ) (setq a (+ a 1)) ) (command "layer" "m" "txt" "c" "5" "" "") (close pl) (redraw) (princ) ) (defun c:I () (run) (setq fil (getstring "\nget name of the file (name.ext) :")) (setq p1 (getpoint "select insertion point :")) (setq p2 (polar p1 0.0 35.0)) (setq p3 (polar p1 0.0 105.0)) (setq p4 (polar p1 (/ (* -1 pi) 2) 20.0)) (setq p5 (polar p4 0.0 35.0)) (setq p6 (polar p4 0.0 70.0)) (setq p7 (polar p4 0.0 105.0)) (setq p8 (polar p2 (/ (* -1 pi) 2) 10.0)) (setq p9 (polar p8 0.0 35.0)) (setq p10 (polar p8 0.0 70.0)) (setq p11 (polar p8 (* -1 pi) 15.0)) (setq p12 (polar p8 (/ pi 2) 5.0)) (setq p13 (polar p8 (/ (* -1 pi) 2) 5.0)) (setq p14 (polar p12 0.0 35.0)) (setq p15 (polar p13 0.0 17.5)) (setq p16 (polar p13 0.0 52.5)) (setq p1- (polar p1 (/ (* -1 pi) 2) 2000000000.0)) (command "text" "m" p11 3.0 0.0 "POINT NO.") (command "text" "m" p14 3.0 0.0 "COORDINATES") (command "text" "m" p15 3.0 0.0 "X") (command "text" "m" p16 3.0 0.0 "Y") (command "line" p1 p4 "") (setq L14 (entlast)) (command "line" p2 p8 p5 "") (setq L285 (entlast)) (command "line" p9 p6 "") (setq L96 (entlast)) (command "line" p3 p10 p7 "") (setq L3107 (entlast)) (command "line" p1 p2 p3 "") (command "line" p8 p9 p10 "") (command "pline" p4 p5 p6 p7 "") (setq L4567 (entlast)) (setq fill (open fil "r")) (read-line fill) (setq new ()) (setq j 0.0) (setq p44 p4) (while (setq S (read-line fill)) (setq pt (polar p44 (/ (* -1 pi) 2) (+ 5 j))) (setq pt1 (polar pt 0.0 12.5)) (setq pt2 (polar pt 0.0 50)) (setq pt3 (polar pt 0.0 85)) (setq t1 (substr S 1 4)) (setq t11 (strcat n t1)) (setq t2 (substr S 5 18)) (setq t3 (substr S 23 32)) (command "text" "m" pt1 3.0 0.0 t11) (command "text" "m" pt2 3.0 0.0 t2) (command "text" "m" pt3 3.0 0.0 t3) (setq p4 (polar p4 (/ (* -1 pi) 2) 10.0)) (setq p5 (polar p5 (/ (* -1 pi) 2) 10.0)) (setq p6 (polar p6 (/ (* -1 pi) 2) 10.0)) (setq p7 (polar p7 (/ (* -1 pi) 2) 10.0)) (command "offset" (+ j 10.0) (list L4567 p4) p1- "") (setq new (entlast)) (command "extend" new "" (list L14 P4) "") (command "extend" new "" (list L285 p5) "") (command "extend" new "" (list L96 p6) "") (command "extend" new "" (list L3107 p7) "") (setq j (+ j 10.0)) ) ;(close) (close fill) ) (defun dtr (x) ;define degrees to radians function (* pi ( / x 180.0)) ;divide the angle by 180 then ;multiply the result by the constant PI ) (princ)
- 2 replies
-
- extract
- coordinates
-
(and 1 more)
Tagged with:
-
Extract text Label and Dimension's to a CSV file
BrianTFC posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I need some help with a lisp routine that I'm attempting to write. What I need to do is extract a panel label by selecting the text and then select the dimensions that I need extract, I've managed to extract the dimensions correctly but when the information is extracted I get is "nil" in the first cell where the panel label should be and the dimensions in the next to cells. I don't Have Excel on my workstation so I have to use CSV file, I've already wrote an extraction code to run in Excel to retrieve the information in the CVS file. Also is there a way to save the CVS file in the same location that I have the drawing open? If someone could help me I would appreciate it. (defun c:test( / s tx fn i d dl m file) (setq ss (ssget '((0 . "*text,*DIMENSION"))) fn "f:\\BrianD\\Dims.csv") (repeat (setq i (sslength ss)) (setq d (ssname ss (setq i (1- i))) dl (entget d) m (cdr (assoc 42 dl))) (setq tx (cons m tx))) (if tx (progn (setq file (open fn "a")) (write-line "" file) (foreach ss tx (princ ss file) (princ "," file) ) (if file (close file)) ) ) ) (princ) Thanks Brian- 21 replies
-
- extract
- dimensions
-
(and 2 more)
Tagged with:
-
Text and text coordinate extract to csv along polyline.
sanju2323 posted a topic in AutoLISP, Visual LISP & DCL
i need lisp The text along polyline to make coordinate & text Code Extract to CSV Sample.dwg Required.csv -
Hi Everyone! I am having a bit of a dilemma. I am trying to find out (not sure what to search for) if it is possible to take data from an OLE and be able to capture it into an ACCESS database. I have an example of what needs to be pulled if this is even possible.
-
Say this is my code: (defun c:test() (setq list(getpoint "\nChoose point here") ) When you click on your autocad drawing i know that it stores the coordinates in a x,y,z format in a list.. How can i extract those numbers?
-
Extracting Point Information from Hangers in CADMEP+
TheyCallMeJohn posted a topic in AutoLISP, Visual LISP & DCL
Does anyone have any knowledge on how to extract the point information from a CADMEP entity without having the CADMEP information? Our clients give us there files and we have to place blocks at each hanger. Extracting the coordinates to populate the blocks would be a huge time saver. -
I am looking into creating a excel spreed sheet that will be used by our company. The excel spreadsheet will be used for getting data (revision status) from a list of selected drawings. In excel you will select the file location and then the list of drawings that you would like the data from. Autocad might need to be opened but can run in the background. Now the main question once the code is completed in excel can it be used in Autocad 2013LT If I am confusing people basic idea. open excel file. run data extraction on selected cad files. sort data by drawing number.
- 3 replies
-
- excel
- attributes
-
(and 1 more)
Tagged with:
-
Hi guys, There are a number of forum topics around the internet asking similar questions, each with good answers (e.g. Lee Mac here) but so far I haven't found an answer to my problem. What I would like to do is extract information from several long polylines (each on specific layers) and create a csv text file of the output, saved to the same directory and with the same name as the .dwg file. I need each row of the .csv file to contain the coordinates of one point on a polyline (X,Y,Z) but then additionally include a fourth 'label' column which would be in the format: [DrawingName]_[Layer] DrawingName = name of the .dwg file Layer = layer the polyline is on Example output: X,Y,Z,Dwg1_layer1 X,Y,Z,Dwg1_layer1 ;one row for each point on polyline X,Y,Z,Dwg1_layer1 .... X,Y,Z,Dwg1_layer2 ;this is the next polyline, on 'layer2' X,Y,Z,Dwg1_layer2 X,Y,Z,Dwg1_layer2 etc The label column is necessary as I need to combine information from many different files and the ability to identify and sort where the data came from is essential. I've attempted to modify existing 'extract XYZ' code that I've found around the internet but it seems to be beyond my current lisp skills . Any help you guys can give would be simply amazing!
-
Extract coordinate data from AutoCAD
ahmerjaved posted a topic in AutoCAD Drawing Management & Output
Hello all, I work in a manufacturing facility and we are trying to come up with a way to extract data from an AutoCAD file in to a .KML or .CSV file which gives coordinate points, etc. This will be used in a mapping-type software to display/highlight areas of the plant with zooming capabilities and information shown on the left-side. We are trying to make it look something like Google Maps, so it can used to determine areas of the plant undergoing work, lighting zones, etc. We are in the preliminary stages of this project and I could use some help/advice on how you guys would approach this. I have intermediate AutoCAD knowledge, hence I am reaching out to the community. In a nutshell, I want to be able to extract coordinate data from our layout(s) which can used to pinpoint locations on the map and highlight regions, etc. Perhaps it could export data in to Excel with attributes assigned to the coordinates which give Area, Bay Location, etc. The initial thought was to somehow export this to a .KML file and use that as a starting point. Let me know what you guys think, and how to best approach this. Any help would be greatly appreciated! Thank you. -
Hi, Is there a way of extracting model data into an excell file / other ? Information such as size, layer, dimensions etc ? Or even grouped / assembled objects names from the object select / type function ? Any help / ideas welcome... Thanks
-
- studio viz
- extract
-
(and 1 more)
Tagged with:
-
I'm looking for a way to extract the X, Y and Z values from a set of selected blocks (there may be several types of blocks) and then have it export to a txt file. I'm not sure if it's possible but I'd like to have it export in the order that the blocks were placed. The format I'm looking for would be like this: x,y,z x,y,z and so on... I can do it in Microstation but would prefer an Autcad Lisp. Any help is really appreciated!!!!!
- 35 replies
-
- blocks
- coordinates
-
(and 2 more)
Tagged with:
-
Spurred into life by this thread, I thought I'd update an old program of mine. I have created this program to enable a user to extract the layer information from multiple drawings in a directory to either Text/CSV file. Example of XML data output using XSL to display data in a CSS styled HTML Table: Enjoy! Lee Code can be found here