AutoCAD Visual LISP / AutoLISP :: Extract Data From DXF File?

Oct 6, 2011

I am trying to write a lisp file that extracts the LAYER, Z, X, Y, TEXT HEIGHT, POINT NUMBER, from the attached DXF file. Ultimately I will have the lisp insert a "POINT" at the X,Y,Z, cords, and then a "TEXT" entity at the same coordinates with the text height value and the point number string. Both entities need to be on the layer ending in  "-PN". The layer name will change depending on the date. I have a third party program that creates the DXF file.

The point of the lisp file is to insert the point numbers and points into my drawing at their correct locations. For the life of me I can not make this work. I have attached the little bit of lisp I have, which unfortunately does not work properly because of it searching for the "TEXT" entry in the DXF file of which there are three per point number. I only need one. I have also attached the DXF file I have. maybe just an overall procedure that I can then code myself? I'm just not good at getting lisp to read a file and extract what I want from it.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Extract Point Data

Sep 18, 2000

I would like a lisp routine that can extract and export the x, y, z coordinates of all the points in a drawing into a text file so I can use the same in excel.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Linetype From DWG File

Sep 12, 2013

I've got a linetype that's part of our autocad template file and has been for so long that nobody around here even knows where the original line file is.

I need to extract the linetype out so that I can make some minor modifications.  I did do a search and found a nifty lsp routine from Paul Turvill.  (Here's the thread that pointed me there:  [URL] ..........

I ran it and it SEEMED to work.  All the linetypes in the file it created look good EXCEPT for the one I needed to extract. That one looks like this in the line file:
 
*TREELINE,Series of arcs used to indicate tree drip lines
A,0.0001,-0.0001,

The linetype DOES display properly in the dwg file (meaning lines drawn using it look good).

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract All Layers In An Open Drawing To A Notepad Or Txt File?

Mar 5, 2012

How can I extract all layers in an open drawing to a notepad or txt file?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Embedded Data In DWF File

Mar 18, 2012

I'm looking for a way to add custom data in dwf files. We currently create 3D models which get exported to dwf format so that we can share information with clients. Ideally, we'd like them to be able to click on any member and have the software provide additonal information about that part. Example, part number. It would be awesome if the client could then say double click that part and have the actual detailed part drawing open up.

The parts we are trying to reference are generated using a third party application, so they are not solids, but the information is easily accessible in LISP.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting Data From Excel File?

Jun 12, 2013

We have a custom LISP program (Written, upadated in 2003) that takes a keyed in item number, opens and searches a .txt file with four coulmns, for the keyed in item number (column 1) and returns a part number (column 2), description (column 3) and any information in column 4.

Here is the Part of the cod in question:

(setq recx (open "H:/ACAD2012/alcocustm/LISP/hardware.txt" "r"))
(setq d "?")
(setq rec (read-line recx))

[Code]....

A quetsion was asked if the data in the .txt file could be put in an Excel file. I tried looking at other post, but I can't seem to find a clear cut way to open and extract the data. Or this old dog overlooked a boand. Is there a easy way to do this, similar to the above?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieve Cell Data From Excel File?

Oct 7, 2011

I would like to be able to retreive data from a sepcified cell, in a specified worksheet, from an excel file.

I don't have any clue how to connect to an excel file and read the data. Most seems to think you already had an understanding but I'm starting from the beginning.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove Hidden Data And Reduce File Size

Mar 27, 2013

I am trying to reduce the drawing file size.  This is for uploading the drawings to AutoCAD WS.  AutoCAD WS doesn't display or edit a drawing that is over 15MB. Unfortunately some of our drawings are over 15MB even after I have removed the background and others and have purged. I believe the reason why a drawing can be so big has to do with each object (grouped object) has a ton of information on it. For example, the properties of a typical object is like this:

( (-1 . <Entity name: 7ffffbece60>) (0 . "PRCD_FITTING") (5 . "145B6") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 7ffffbece70>) (102 . "}") (330 . <Entity name: 7ffffbf59f0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "CPrcdEntity") (280 . 10) (90 . 601861454) (70 . 24058) (70 . 4567) (280 . -65) . . Skip 3000 lines here for clarity . (90 . 0) (90 . 0) (90 . 0))

You can see from above that the list of properties are huge.  All I really need are the visible parts of the object.  This means most of the info above are junk.I try to reduce the size of object by exploding all the objects on the drawing.  This sort of work in the sense that the file size of a test drawing is reduced from something like 8MB down to 6MB.  But I am expecting far more reduction than this.  The reason why I expect far more reduction is that the total number of lines of the exploded items of the same object mentioned above is reduced from 3000+ lines to only 300 lines as shown below:
 
( (-1 . <Entity name: 7fffe8654f0>) (0 . "LINE") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B11F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "AcDbLine") (10 4188.87 -423.095 156.0) (11 4188.87 -387.095 156.0) (210 0.0 0.0 1.0))( (-1 . <Entity name: 7fffe8655f0>) (0 . "LINE") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B12F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT") (62 . 1) (100 . "AcDbLine") (10 4248.87 -453.095 156.0) (11 4212.87 -453.095 156.0) (210 0.0 0.0 1.0)).. Skip 250 lines here for clarity.( (-1 . <Entity name: 7fffe865260>) (0 . "MTEXT") (330 . <Entity name: 7ffffa1b9f0>) (5 . "3B0F6") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "BON-SupplyMP-3.0-4.0 RECT-ANNO") (62 . 1) (100 . "AcDbMText") (10 4193.39 -418.589 150.0) (40 . 3.0) (41 . 19.8) (46 . 0.0) (71 . 1) (72 . 1) (1 . "\Fdim.shx;\W0.7000000000;\T1.0000000000;\o\l24X30THRT") (7 . "BonDuctTXT") (210 0.0 0.0 1.0) (11 1.0 1.46161e-017 0.0) (42 . 17.5) (43 . 3.0) (50 . 1.46161e-017) (73 . 1) (44 . 1.0))

Therefore, I am expecting a 10-to-1 reduction, not just a 1/4 reduction.I am wondering there may be hidden data on the drawing that are left behind after I have exploded the objects. if there is a way to get rid of the hidden data?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Label From New WCS

Jun 4, 2013

I need a lisp routine that will allow me to pick a polyline and label with azimuth and distance (direction-north, clockwise) of a new WCS.

Is there any code that extract information for a new WCS?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Image Name From WMS

Nov 25, 2013

I have a drawing that has an aerial Images inserted into it using a WMS Connection How to extract Image Name through Autolisp from this

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract A Folder Name Within Dwgprefix

Aug 17, 2012

I’m looking to extract the second from the last directory within the dwgprefix of

"P:Projects66 Structural666-4800-00 TPA666-4815-00 Res4815 Res Figures"     (i.e. 666-4815-00 Res) 

This is what I have so far:

(defun c:tmp ( )
(setq P1 (getpoint "
Pick point: "))
  (command "text" P1 "" ""
    (strcat
      (vl-filename-base
        (vl-string-subst "." "\" (getvar 'dwgprefix) (vl-string-position (ascii "\") (getvar 'dwgprefix) nil T))
   ))))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Elevations Of Polylines

May 28, 2013

A quick lisp routine to extract the elevations of a selection set of 2d polylines?  I have a massive "contour" file composed of 2d polylines with elevations.  I need to find the min and max polyline elevation in selected areas.  I can't figure out how to extract just the elevations of my selected polylines so I can quickly see the elevation values? 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Values X Y Z From Vlax-3D-point

Jan 3, 2012

how to extract value X Y Z of point p3 p4

(defun c:test ()
  (vl-load-com)
  (setq actdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
  (setq objm (vla-get-ModelSpace actdoc))
  (setq obju (vla-get-Utility actdoc))
(setq oldhigh (getvar "Highlight") oldsnap (getvar "Osmode") oldblip (getvar "BlipMode") oldecho (getvar "Cmdecho") );setq
(setvar "Highlight" 0) (setvar "Osmode" 517) (setvar "Cmdecho" 0)  (setvar "Blipmode" 0)

[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Attribute Tag Value And Draw Polyline

Apr 25, 2012

I have a inserted block with 4 tags for Length, Thickness, Elevation and Width.How can extract attributes tag values and draw a closed polyline + 2 internal lines, parallel to the block?

Block Name: ID_DATA
Tags: LEN, THI, ELE and WID.

Each internal line placed in a third width.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Any Way To Extract All Dimension Text At End Into Excel

Aug 16, 2012

I'm dimensioning an old drawing with the real (measured) dimensions and with the drawing dimensions in brackets (using ' 1500 (<>)' to give '1500 (1505)' for example.

What I'd like is to also be able to put on the difference between the length I type in and the length in brackets - as this would let me see any really glaring errors that can't be attributed to user-error on the laser measure.So I could type in '1500  (<>) (X)' where X is the formula, and get ' 1500 (1505) (5)' back?

How to be able to run a script that could highlight any dimensions where the number is brackets and the typed number have a a difference of, say, 50.Or failing that, any way to extract all the dimension text at the end into excel so I can see the differences myself?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Sensibly Extract Angular Dimensions As Attributes

May 14, 2012

how to sensibly extract angular dimensions as attributes.

I can extract the attributes from a block containing angular dimensions, the attributes list angular dimensions as a field but don't actually list the number of degrees for the angular dimension.

It is the number of degrees that I am actually trying to obtain - but I cannot work out how to obtain the information

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Field Expression of Attribute In Block

Mar 8, 2012

Is that possible to have a lisp to extract the Field Expression of a attribute in a block?Specifically, to extract the property VALUE (TextString) of this attribute.After to extract, I would like to put this text extracted in a different layout tab, in the same drawing. In this way, I will have a text linked to the attribute value between two layout tabs. So, when I have to change the attribute value, the text will be updated automatically.

I know that if I use the FIELD command to manually copy and paste this value it will work, but when I have a lot of attributes it becomes very laborious.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Radius And Height From Cylinders And Boxes

Jul 23, 2013

I design a small plant in Autocad 2012. For the pipes we used cylinders and boxes(for square pipe), now we need to make the bill of materials, but I don't know how to extract the data from each cylinder(radius and height) or box.

It is possible to do this?

I place a small sample from the plant. Totally I am having around 6000 elements.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Evaluate That BOTH Attribute Tags Exist In Block And Extract

Sep 15, 2011

I was wondering if it was the COND statement that I would need to use to evaluate a block to confirm that two attribute tags existed  and if so, if would process the block to perform an attribute extraction of both of those tags. It would ignore blocks that only had one or the other attribute tags - and only extract the attribute values if the block had BOTH of the tags present - It could be blank, but it had to exist.

For example, I want to find blocks that have the attribute tag "PART_A" and "ID" - and then create a CDF that has the value of "PART_A" in the first column and "ID" in the second column. Then it closes my CDF file.

Then, I want it to scan my drawing again for blocks that contain attribute tag "PART_B" and "ID" and then re-open that CDF file and append the values so that the values of teh attribute "PART_B" is in the first column and the values of the tag "ID" are in the second column.

I have been playing with the following code --- is there anyway to modify the code to get it to do what I need? I have already removed the part that writes the header-row....

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Data From MS Access?

Dec 19, 2011

I woluld like to use visual lisp to get data from ms access.

I know how to connect to Excel, but is there a similar connection possible for access ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel?

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Accessing Data From An Object

Jun 19, 2013

How to access the information stored with an AcDbScale object using Visual Lisp.  I can convert the vla-object to an ename and then use association codes to extract the data, but surely there's an easier, more direct alternative.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Data Populated From List

Oct 7, 2011

In the example given I have two instances to show how unique the information can be.

I would like the left column of words to be some type of drop down or list so that the user does not have to type these for each line. I don't care if it's attribute, text, mtext, just whatever gets it done.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Many Lines With Its Data

May 28, 2012

I want to make many object cooper lines in autocad and each line has some data about its length, size, type etc.  that can then extract to excel as a Bill of materials. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data From DWG To Excel

Sep 4, 2012

I have Export data from dwg to notepad lisp programe. But i need lisp programe for Export data (Easting,Northing and Level) from dwg to excel.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Data Extraction By Commandline?

Aug 1, 2013

Can I run the dataextraction command via a command line and respond to the prompts via lisp or script. In other words is there a commandline version of dataextraction - setting cmddia to 0 doesn't work.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automated Drawing Using Input Data?

Jul 4, 2013

I would like to automate drawing process for certain data. Using some LISP codes User will be asked to provide some data and using that data an automatic drawing needed to be developed at Drawing editor of AutoCAD. For example;

Enter the width of Sheet: 50 mm
enter the length of Sheet: 200 mm
Enter the sheet thickness: 5mm
Enter type of feed: Automatic
Are there holes in Strip: Yes/No
Specify nu of holes: 5
Position of holes Centre: 5,5
Distance between the holes:  At an interval of 20mm each

I just need a LISP code for such program.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding Point As Extended Data?

Jan 29, 2013

I was trying to add a point as extended data to a block.

Therefor i used this data but i get an error every time:
 
(setq lastent (entget (CAR (entsel))))(regapp "list")(setq exdata '((-3("list" (1011 . 3277.82) (1021 . 5782.5) (1031 . 369.5) ) ) ))(setq newent (append lastent exdata))(entmod newent)

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Data To Any Database Application?

Apr 19, 2013

I would like to save the data generated by LISP program at command prompt area to any data base app or any simillar app from where I can retrieve the stored data again in autocad for further usage. 

For example, A LISP program generate the result as shown in above Fig. I would like to save the data of step 5, "Shear force in tonnage is : 50.868" to any database application or any simillar one from where I can retrieve the stores data for further usage.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Global Attribute Data Adjustment

Sep 10, 2012

I have attribute data that is entered as a format of 25-6. I need to make these into feet and inches, 25'-6". Is there a way to update these attributes globally or even at least by choosing the block itself? The only thing I can think of is find and replace and I just feel there has to be a better way.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Data Extraction From Polylines And Arcs

May 20, 2013

There is a AutoLISP for extract START and END coordinates in X, Y, and Z planes, and extract length of Polylines and Arcs.?

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved