AutoCAD Visual LISP / AutoLISP :: Go From TEXT And LINES To TABLE?

May 6, 2009

The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.

I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.

Any LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Change Table Text In One Time

Jul 21, 2012

I want to change a lot of table cell text in one time, try to explain something.

In the front of my drawings i have a view tables. in the second column stays a code that represent a location.

e.g. LVC stays for Low voltage cubicle. Now it is my intention to substitute these code to the description of code in one time and only the second column. The several descriptions are written in an .txt file, like LVC;Low voltage cubicle and on the next row LVP;Low voltage panel, and so on.

I think it is only possible with Lisp? or there are other way?

In the past i did it one by one, because mostly there where 2 or 3 tables, now i have a big project with more than 20 tables.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Color Of Text In Table Cell

Nov 23, 2011

The following snippit of code is changeing the color of text in a cell of an AcadTable.  It will set the color to an RGB value and works great.  But what if the color is a normal color 1 through 255 from autocad's pen table.  How would I set the cell text color?

(setq objColor (vla-getcellcontentcolor eVLAMT R C)) ;sets a Color Object, whatever that is
(vla-setrgb objColor RED GRN BLU) ;sets the new color of the Color Object
(vla-setcellcontentcolor eVLAMT R C objColor) ;sets that new color object to the cell

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using TEXT Not MTEXT To Create Multiple Lines Of Text?

Oct 4, 2011

3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.

I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.

The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
 
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write Several Lines Of Text To TXT File?

Apr 13, 2012

I know how to write a single line of text to a txt file with LISP, but how do i write two or more lines of text to a txt file ussing lisp?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Placing Multi Lines Of Text In DCL Edit_box

Jan 10, 2012

Is it possible to have Multi lines of text in a .dcl edit_box or such? 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Put Multi-lines Of Text Into Drawing Info Comments

Dec 19, 2011

I am able to insert multi line text into the Drawing Properties Summaryinfo standard field "comments" by using  string concatenation in VBA by using "mytext" & vbLF & vbCR "mytext".

But I can't find a way that works in autolisp. This code does not work.
 
(defun c:FillComments (/) (vl-load-com) (setq acadObj (vlax-get-acad-object)) (setq acDoc (vlax-get-property acadObj 'ActiveDocument)) (setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo)) (setq *customer* "MyCustomerName") (setq *location* "MyLocation") (setq *project* "MyProject") (setq*comments* (strcat *customer* ", " (chr 10) (chr 13) *location* ", " (chr 10) (chr 13) *project* ) ;_ end of strcat ) ;_ end of setq (vlax-put-property acDocSumInfo "Comments" *comments*) (princ)) ;_ end of defun
 
The text comes in but all on one line.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Style Used By Table Style

Jun 29, 2012

I am looking for a way to change the text style used by a table style with Visual LISP.  So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style.  Is this even possible?  Code and results are below.

(defun DumpTableStyles ()
(setq dict (vla-get-dictionaries (vla-get-activedocument(vlax-get-acad-object))))
(setq TableStyles (vla-item dict "acad_tablestyle"))
(vlax-for TableStyle TableStyles
(vlax-dump-object TableStyle)
)
)

[Code]....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Cell Value From A Table

May 31, 2013

I have set up several tables inside autocad that have one cell as the input cell and after regen the others perform calculations based on that cell. I want to write a command that uses the same value as the input value to draw the arc to scale. I tried using the table value as is called out in the cell field:

^C^C_arc 36,6;e;0,6;r;Table(8796085192704).A3;.

Is there anyway to get a value from a cell inside autocad and put it into my macro so I can draw an arc of the radius shown?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Intersect Between Two Lines Using Start And End Values Of Two Lines

Oct 11, 2013

With all of you fine teachers, I have the know-how to get the start and end values of a line.

Do you think there is a way to get a point returned that represents the true intersection of the two lines, without having to involke a user defined "getpoint" function using "intersect" osnap?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Coordinates To Table

Mar 19, 2013

I need to draw a table with point number, easting, northing, elevation for a lot of points and need a lisp to read the xl spreadsheet and draw the table.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Unlocking Cell In A Table?

Aug 29, 2012

Is there a way to unlock a cell using lisp. I have a datalink that is used to create a table. Once the table is selected I have a command that will format some of the cell style (which will let me while locked), but it I cannot seem to find a way to unlock them to merge a couple of cells. I can manually do it using the table toolbar, but programmably I am a little stuck. I can see if it is editable by using the vla-iscontenteditable and it will return :vlax-false. I do not see a vla-setcontenteditble or something to that effect. 

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rotating A Table To Current UCS?

Sep 12, 2012

Tables do no have a rotation angle. I can find the insert point, but there is no other point to make an angle calculation with. 

(setq objTable (vlax-ename->vla-object (car (entsel))))

(vlax-dump-object objTable T)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Table Cell Content Name

May 14, 2012

I have a table, in cell D3  I have inserted a field containing a system variable. The contents of the cell looks like this,

%<AcVar dimadec>%

I want to put in cell D2 the name of the vairable that is in cell D3 - I have tried the following,

%<AcExpr (D3).ObjectName>%
%<AcExpr (D3).textstring>%

Is there any way to reference the name of that system variable contained in cell D3? I want to do this to prevent errors by curious new users that may edit the table, I want the table to reference itself so that the system variable being read is always related to the correct system variable name.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Table Search With Wildcards?

Dec 9, 2011

any code that can search for a layer using wildcards?

In my specific case, I have multiple layers than begin with "MECA" followed by a job code. I'm trying to code something that will check to see which of those layers is on, then return the layer name.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Make Sum Field In A Table

Jun 24, 2013

i have one table make which field from block. Is  possible sum?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Compare 2 Cells In A Table

May 15, 2012

Is there any way to compare 2 cells in a table? I have tried diesel

$(if,$(EQ,%<AcObjProp Object(%<\_ObjId 2128896328>%).b2>%,%<AcObjProp Object(%<\_ObjId 2128896328>%).d2>%),true,false)

I can't seem to pass the cells into the equation. I tried formulas also with no luck.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Construct Lines Between Lines Ending Points Multi Selection?

Aug 3, 2013

I want to construct lines between every two line ending point by multi selectio window instead of drawing it manually between lines ending point ?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Programmatically Import Excel Table?

Apr 25, 2013

I would like to link an AutoCAD table to an Excel file with the first method described in this page:

[URL]

I know the filename of the Excel spreadsheet and the range as well.

Is there a way to make a script that links the table and then detach the link after that ?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Table Cell Background Color

Aug 19, 2013

I have created subroutines to build tables in AutoCAD.

What I would like to do is to is if a value in the table list (example a question mark), then make the background color of that cell color 1 (red).

List to insert as a table -
(setq List_Table (list (list "A" "?" "C" "D" "E") (list "11" "12" "13" "14" "15") (list "21" "22" "23" "24" "25")))
(Build_Table "Title" List_Table 3 5 0.1 1)

Here are the subroutines -

(defun Build_Table (TableName List_Table NumRows NumColumns RowHeight ColWidth /); P0 Table_Obj KW KK KT KL Blocks_Obj Block_Obj Block_Id)
  ;--set table scale-------------------------------------
  (setq Dscale 1.0)
  ;--get location----------------------------------------
  (setq P0 (vlax-3d-point (getpoint (strcat "

[Code] .......

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Table Column Widths

Apr 26, 2012

How to modify the column widths of an ACAD_TABLE?

I have known co-ordinates that I want each grip for the table to be set at.  I can't just copy and paste the table from drawing to drawing.  Each table of each drawing have different textual values, and the column widths will best be sized for each text value.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Alternating Background Fill In Table

Oct 1, 2013

Any LISP routine that I can run that will make alternating rows of color in a table?

I can setup a table with the TABLE command and setup the rows to alternate gray and white, but if I add or delete a row, the alternating background fill pattern gets messed up (see attached example).  Manually redoing the pattern isn't bad for a few rows, but for 30 or more it's a real pain.

If I could run a command that would activate a routine that would start with gray at the top and then alternate white and gray for every row for the rest of the table, that would be awesome.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Plot Style Table?

Oct 3, 2012

Is it possible to create a lisp that would change the plot style table?  I don't know of any variable to type to change that.  We convert drawings from Solid works to AutoCad and use the basic monochrome plot style.  I'd like to easily change that since the act of doing that is repeated many times.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Generating Table With Point Number From Attribute?

Sep 8, 2011

I have a simple block that consists of a point and an attribute that contains the point number. I want to generate a table with point number from the attribute, and x, y and z of the block's insertion point. I want a routine that sets out the blocks and then create the table. The first part of the routine I have (in LISP), I need it to generate the table. I was intended to use the -DATA EXTRACTION but unfortunately it does not allow me to select objects (blocks). Are there other ways to do this? I'm using AutoCAD 2011.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit A Table Where Cells Are Populated With Fields

Aug 29, 2013

I've been up and down the forums looking for some direction or programming code for this to no avail.

What I'd like to do is edit a table where the cells are populated with fields.  I'd like to copy the last row of the table to a new row (fields and all), then change the fields of the row I copied FROM to text, and lock those cells.

I'd like to copy this row including the fields to a new row beneath it.  Then edit the cells of the first row to change the fields to text, and then finally lock the cells of the first row so that only the new row would update when the field properties change.  Eventually they will be populated with data from the Vault..

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create A Table With All Characters Inside A Font

Jan 4, 2013

I want to create a table with all characters inside a font.I used "%%" to change a number to it's character.but "%%" limited to 999 and for numbers bigger than 999 it doesn't work.

also, CHR command limited to 255 and for numbers bigger than 255 it change to (number-255). so I used "%%" to create this table:[Please change default font in your AutoCAD to ARIAL]

(Defun c:charmap ()
(setvar "cmdecho" 0)
(setq cnt 1.0)
(setq r_cnt 0.0)
(setq ts 32)
(setq x 0.0)
(setq y 0.0)
[code]...

I want to know:

1- what can I do for numbers more than 999?

2- How can I know the number of characters inside a font?

3-how can improve my LISP program to have complete characters inside the fonts?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Polyline Deflection TYPE Angle Table

Jul 19, 2013

The attached image shows a table that I created as a AEC Object from my Civil 3D Alignment (i can turn it to 'MText' and then 'Text' in one or two steps). What I need is a routine, or anything, that fills the third column with an information based on the second column: the deflection angle, something like that:

Curve       Angle         Type of angle

  C1       22°30'00''               2

  C2       39°21'28''               3

  C3       44°59'59''               3

  C4       45°00'00''               4

  C5       45°00'01''               5

Is there something I could read to study to solve it myself and specify my own angles/types of angles?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Total Length Of Selected Object And Summarize Them A Table

Jan 4, 2014

I need a lisp file that can read the total length of selected object (lignes, polylines) and summarize them by layers or by color in a table

e.g

command:tl (total length)
select objects
found total length.......
select object (Ent)
total length or [Add/Subtract/Table] :
total length = .......
if table
Enter an option by [ Layer/Color/line Type/line Weight] <layer> :

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Table Style - Error Message / Bad Argument Type

Mar 22, 2012

By running this routine it returns the following error message:

ERROR: bad argument type: VLA-OBJECT 7

(defun _make_tblstyle  (stlname / adoc acmcol tblstyle txh)
(setq   adoc (vla-get-activedocument
(vlax-get-acad-object))
)
(setq   acmcol (vla-getinterfaceobject

[Code] .......

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Generic File That Summaries Areas Of Hatches In Table?

Mar 19, 2013

Generic lisp file that summaries areas of hatches in a table,

I’m wondering if there is a lisp file that can read the boundary of the study area and the hatches and stick there areas in a table as shown in the attached screenshot

The areas of the roads are derived by subtraction the total area of hatches from the area of the study area.

The dwg file is attached

This is very frequent sort of work and takes a lot of time to be constructed. I’m already using fields to perform this kind of work.

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line Between Two Lines?

Feb 15, 2013

I am trying to draw a line between two lines and I put together the following. It works great if the start/end points are perpendicular to each other. How do I solve if line one start point is in a positive direction and line two is in a negative direction? 

(defun c:test ()
 (setq L1 (car (entsel "
Select the first line: "))
L2 (car (entsel "
Select the second line: "))
 )

[code]....

View 9 Replies View Related







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