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


ADVERTISEMENT

AutoCAD .NET :: Creating Table With Preset Column Widths?

Mar 25, 2013

I have been able to create a table, populate the Title and Headers with text.  Which is all I want it to do for now.  The problem is, I can calculate how wide I want each column, but it never gets drawn with the correct column width.

how to make it use the correct column width specified?  Keep in mind all of the column widths may differ.

Attached is my code.
Public Sub AddTable(ByVal dwg_scale As Double, ByVal dwgTextHeight As Double) Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Dim ed As Editor = doc.Editor Using tableTrans

[Code].....

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Second Column From A CSV?

Oct 18, 2012

If I have a CSV file (with no header) that contains three columns and I want to return values of  the second column as a list, how is the best method to do that?

I have seen something where one can separate a string into a list by a divider (in my case, the commas between the three columns) but the actual code for me to inspect was supposed to be in an attached ZIP file which I didn't see as part of the post.

An example of my CSV (as a list) wouild be:

("PO-30-10,PIN OAK,88-15" "PO-30-10,PIN OAK,88-01A" "JS-20-5,JUNIPER,63-04" "PP-40-10,POPLAR,38-22")

and I need the resulting list to be:

("PIN OAK" "PIN OAK" JUNIPER" "POPLAR")

Is there a LISP way to do this - or only VLISP?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Sheet Column

Aug 13, 2013

I'm trying to get an excel sheet to open and count cells based on the text inside a selected column then compare it to cad. The column says "red" or "green" and I want to compare it to a count of red and green hatches in cad.

I managed to get them to be counted in cad but I'm not sure how to get the excel part to work.

Note: I posted an earlier post thinking to count the actually color in the excel cells rather than the words but that ended up being quite complicated.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Importing An Excel Column Into A List?

Sep 6, 2012

I am trying to import a list of customers from column A in an Excel file into a list for a popup_list for my Drawing Properties DCL.  I am having trouble finding information on how to do this.

Basically: Load the file, (workbook through active sheet: vlax-get-property)

(setq xlSheets (vlax-get-property xlBook 'WorkSheets) )

Then, how do I get it to put column A properly into a list for the DCL?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add / Modify And Remove Registry Key?

Feb 27, 2012

Some time ago I was able to add modyfy and remove regestry keys ussing AutoLISP Unfortunatly I have lost the information on how to do this.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Hatch Code

Aug 20, 2013

Modify the attached lisp I found in this forum to work using a different hatch pattern, scale and angle.  The new hatch should be in default Autocad "LINE" pattern and angle set to 90 degrees (vertical). If possible, I would like the angle and scale to be editable.  Find attached Multi_Hatch-45 code posted by CADaStroumph in 2008.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Existing Selection Set?

Sep 5, 2012

I need the same funcionality as in code below, but without using "command".

The main idea is alowed user to modify Existing Selection Set.

 (defun gt:ss->lst (a:ss / i lst ) ;_ / (setq i 0) (if a:ss (progn (repeat (sslength a:ss) (setq lst (cons (ssname a:ss i) lst) i (1+ i) ) ;_ setq ) ;_ repeat (reverse lst) ) ;_ progn ) ;_ if) ;_ defun gt:ss->lst(defun gt:ss_modify (a:en-lst / ) ;_ / ;;create Selection set (setq ss2 (ssadd)) (foreach f:en a:en-lst (ssadd f:en ss2) ) ;_ foreach ;;Run command and fill with initial content (command "_select" ss2) ;;Alow the user to modify the contents (while (/= (getvar "cmdnames") "") (command pause) ) ;_ while ;;get back the list of enames from modified selection set (setq ss3 (ssget "_P")) (setq ss3-lst (gt:ss->lst ss3))) ;_ defun gt:ss_modify(defun tst:gt:ss_modify ( / ) ;_ / (gt:ss_modify (gt:ss->lst (ssget)))) ;_ defum tst:gt:ss_modify

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adjust Column Width To Length Of Text

Apr 27, 2012

Several times, we generate a drawing, and the text widths in the columns vary greatly.  Some have text that is ten characters long, and others have thirty-plus characters.

Is there a way to be able to select the table (or perform the command to all tables in the current layout) and have each of the columns expand to the appropriate width, that depends on the longest string of text in that column, for each column.  The problem I see, is that some tables have two columns, some have six, and of course other with any number in between.  The same is also true for the amount of rows.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Insertion Point Of Text

Jan 10, 2008

How do I change the insertion point of a text using "vla-put" ? I've tried using :

(vla-put-InsertionPoint en a)) with a = (4455.94 428.576 0.0)

and I get the following error:

lisp value has no coercion to VARIANT with this type: (4455.94 428.576 0.0)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Line Inside A Block

May 20, 2013

I have a simple block with 2 attribute and 1 line inside it.

something like this:

Attribute1

──────

Attribute2

I want to modify length of line due to width of thoes attributs. length of line is equal to maximum(width attribute1 and width attribute2).

dxf code for start point of a line is 10 and end point for a line entity is 11.The question is: how can I modify the length of line automatically via maximum width of these attributes?

for getting width of a text:

(defun GetWidth ( en ) ((lambda ( lst ) (- (caadr lst) (caar lst))) (textbox en)))
sample:

A1
──────                    
Attribute2

Attribute1
──────           
A2

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Properties On Multiple Drawings

Nov 6, 2012

Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?

There are several instances where we would need to take a project to create another one and simply change the title block description.

As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.

These are not attributes, but fields. I've researched alot on here and couldnt find anything.

The drawing is attached.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify The Existing Parametric Parameters?

May 2, 2013

Is there a way to modify the existing Parametric Parameters that are in the Parameters Manager using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Objects Copied From A Selection Set?

Nov 17, 2011

I am creating a selection set using ssget...

Then I copy that selection set multiple times in a loop.  What I would like to do is then rotate (or otherwise modify) the last copied group of items.  If I rotate "last" it will only accept the last drawn item, so only one item in the group of copied objects will rotate.

Here is the portion of simple code I am using right now (it's in a loop so all variables with 'Next' are changing each time):

(command "_.copy" SS1 "" SS1Base NextPT)
(command "_.Rotate" "l" "" NextPT NextAng)

This works fine with a single object, but I can't figure out how to call up the entire group of objects.

Civil 3D 2011
Windows 7 x64

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Or Subtract To Modify Value In Text String

Oct 18, 2011

I need a lisp routine that will add or subtract to modify a value in a text string. Its used for drainage fixture units on waste & vent plans. Example: We use basic dtext strings that look like this [color=red]4"(6)[/color]I would like to be able to add or subtract to the number that is [b][size=12pt]ONLY[/size][/b] in parenthesis and would like to be able to pick multiple text strings at one time so it would result in something like this: [color=green]4"(6)[/color] + 9 will become [color=blue]4"(15)[/color].

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Dim Text Color In Current Dimstyle

Jun 27, 2012

How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Property - Insert Polyline As Block

Sep 22, 2011

I am starting with a polyline then i use the pasteblock command to insert that polyline as a block.Now i can pull up the property box and change the xyz scale.

I would like to know how to change these setting in my lisp.The scale will be x=1 y=0.1 z=1

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Top Block Of Column And Get Bottom Left Bounding Box Corner

Jul 10, 2013

I have blocks forming a column, and I need to allow the user to select the top block of the column but return the bottom left corner of bounding box of the bottom block in the column. 

(DEFUN NXT-INSPNT (/ BLKLST CURENT CUROBJ IDX IPNT MCMD NENT SEL SS VENT) (PROMPT "
>> Pick the Category HEADER to add note:") (SETQss nilss (SSGET ":E:S" (LIST (CONS 0 "INSERT"))) )
(IF ss (PROGN (SETQ sel (ENTGET (SSNAME ss 0)) iPnt (CDR (ASSOC 10 sel)) )
(princ iPNT) (setvar "attreq" 0) (VL-CMDF "-INSERT" "LEG-NOTE" "S" 1 iPnt 0 PAUSE)

[Code] ....

 I'm not exactly sure where my code is failing but I get the following error.

error: AutoCAD.Application: Null extents

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block And Modify Stretch Points

Nov 30, 2010

I have a dynamic block that I would like to insert via a lisp routine. When the routine is run from my menu I would like to select two points on the drawing area. Then I would like my dynamic block to be inserted at one of the points I selected and then I would like a specific "point" of my block to be stretched to the other point that I selected. I was wondering if this is possible with LISP? I have my old LISP program I wrote that draws a leader and then inserts my block but that was before I started working with dynamic blocks.

Here is my current

(defun c:wldsym()
(setq osnapold (getvar "osmode"))
(setq orthold (getvar "orthomode"))
(setq dimsc (getvar "dimscale"))
[code]...........  
  
wld1r.dwg is my current block. It has some dynamic properties already. But I'm trying to add new properties that can be seen in my working test drawing wld1r-new.dwg

When using my code with "wld1r.dwg" you can see how everything behaves right now. Then open "wld1r-new.dwg" and note that the insertion point and a stretch point my default are in the same spot. Work with the two stretch points and look at how the block reacts.

View 9 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 :: 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 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 :: 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 :: 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







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