AutoCAD Visual LISP / AutoLISP :: Open Excel Program And Count Cells Based On Colour?

Jul 30, 2013

Is this something that is possible? Basically I have an excel file with sample data that comes coded (red background for fail, Green for pass) Then we transfer that into halos on a DWG. got a routine to count the halos in a DWG. Now I was thinking it would be nice if it compared the number to the excel file to make sure no mistakes were made when placing the halos.

So as I mentioned I've seen rountines to read data in cells but none to count cells based on colour.

View 8 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Macro To Open Third Party Program From Toolbar Button

Feb 7, 2012

I'm trying to create a macro for a toolbar button to open a third party program. Basically we want to open a custom .exe application from a button on the ACAD toolbar.

View 5 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 :: 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 :: Count Dynamic Blocks

Dec 17, 2012

Lisp routine to count the number of dynamic blocks of a specific name ("FD") by windowing an area of the drawing. I have a routine that I've been using to accomplish this, but i don't understand why it doesn't count dynamic blocks.

(DEFUN C:LOCATEFD(/ BLKNAME BLOCKSET TOTAL)
(SETQ BLKNAME "FD")
(PROGN(SETQ BLOCKSET(SSGET(LIST(CONS 2 BLKNAME))))
(IF(= BLOCKSET NIL)

[Code] ....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Leader And Block Count

Nov 29, 2011

I am looking to modify a block count lisp, the lisp counts the blocks and displays them in the command line. I am looking to take that list and insert it in to a leader.

So it will prompt me to select blocks.

1st Point of leader
2nd point of leader

and would generate the block list in the leader annotation.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get A Block Count Without Opening DWG Object DBX

Jan 29, 2013

I need to write some code to count blocks inserted on the drawing....  I want to count also dynamic blocks... most of the time dynamic blocks are anonymous... so I'd need to check the Effective Name.

This line gets the blocks in the block table...

... but how do I get the blocks actually inserted in the dwg?

(setq blks (vla-get-blocks odoc))

Will a regular lisp expressions (like below) work with ObjectDBX... (drawing file not open)?

(setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "`*U*"))))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Count Blocks In Paper Space

Dec 9, 2013

I need to count the blocks in paper space automatically. Is there any method or lisp for this.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Count Dynamic Block Including Total Length?

Apr 2, 2012

lisp to count dynamic block including total length.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Text Based On Room Dimensions?

Dec 19, 2012

make a LISP that will work with my room dimensioning? I'd like to be able to specify the width and depth of the room using a command similar to the "dist" command, and then click a point to place a text based on the distances gathered. I'd also like the text to be formated into architectural units and displayed like this: 12'-0" X 13'-5". Also, if possible, round the result to the nearest inch (to avoid 1/2" and 1/4" dimensions).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layers Based On Attribute Name Tags

Oct 11, 2011

What I am trying to do is grab the value of the owner tag (of which there are four), and use that value to determine which layer to place it on.  What it seems to be doing is hanging.

Here is what I have so far:

(setq SSBlks (ssget "x"'((0 . "*INSERT"))))
(while (/= (sslength SSBlks) 0)
(setq w(sslength SSBlks) V 0)
(setq attentity (ssname SSBlks 0))
(setq attname (entget attentity))
(setq cntr 0)
(while (< V cntr)

[Code] ......

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Loop Based On Number Of Selected And Filtered Objects

Jun 13, 2013

I am looking for a way to extract (filter) all polylines, and loop a lisp based on the number that are found within a "W" selection window.I am frustrated getting "malformed list" or errors, even after defining "n" for repeat.The code I have so far looks like this:

(defun cWW (/ p1 p2 sspw myObj ss)
(setq p1 (getpoint "
Pick first corner: "))
  (setq p2 (getcorner p1 "
Specify opposite corner: "))
  (if
   (setq sspw (ssget "W" p1 p2 '((0 . "*POLYLINE")))
 [code].....

Without the (repeat () portion, it was working ok with selection window, however it only would run the commands for a single polyline.  What needs to be done without overhauling the code?  The lisp has worked on a drawing-wide basis, however needs to run on only on user-windowed polylines since there are other polylines within the drawing which are attached to layouts via viewports. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Assign Variable Based On The Number Of Characters To Be Removed

Apr 1, 2013

(defun layun (target_obj / original_layer original_layer_info target_obj_atts new_layer )(setqoriginal_layer (cdr (assoc 8 (entget target_obj)))original_layer_info (tblsearch "layer" original_layer)target_obj_atts (entget target_obj));setq(if (or(wcmatch original_layer "*-P123"); REMOVES 4 CHARACTERS(wcmatch original_layer "*-P123456"); REMOVES 7 CHARACTERS(wcmatch original_layer "*-P123456789"); REMOVES 10 CHARACTERS );or(progn(setq new_layer (substr original_layer 1 (- (strlen original_layer) ??))) ; NEED TO ASSIGN VARIABLE TO MATCH THE NUMBER OF CHARACTERS TO REMOVE(if (not (tblsearch "layer" new_layer))(progn(entmake ;;;begin to make new layer(list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord")(cons 2 new_layer) ;;; layer name(assoc 6 original_layer_info) ;;;re-use original linetype'(70 . 0) ;;;flags - use default flags(assoc 62 original_layer_info) ;;;re-use original color);list);entmake);progn);if(entmod (subst (cons 8 new_layer) (assoc 8 target_obj_atts) target_obj_atts)));progn);if);defun

assign a character where ? is shown so that it matches with the number of characters to remove based on the 3 lines above (see wcmatch lines).  At present, whatever number I replace that ?? with, it removes that number of characters from the layer that I selected (if it meets that WCMATCH criteria).  Another option which may be more difficult is to be able to have the routine look at the object layer and if it contains -N- or -D- or -NEW- or -DEMO- then to remove all the characters that follow these layer modifiers.  This way I can cleanly add another project modifier behind these modifers. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Activate Alert Window Based On Drawing Timer

Jun 19, 2012

I was interested in finding out if it's possible to write a LISP routine that would execute a pop-up dialog box say every 30 minutes.  This is strictly for ergonomic reasons to remind the user to take a pre-determined break.

I am not an expert code writer by any means, but I imagine the routine would autoload and resetting the timer to 0 upon opening a particular drawing file.  The LISP routine would then run in the background and run the (alert "") command when the timer reaches 30m 0s.  When the user presses the OK button, the timer resets to 0 again.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Dynamic Block Based On Previous Selected Point

Apr 9, 2012

For a program i am working for i have to extract the base point of a dynamic block.

This can be done perfectly by this function:

(cdr (assoc 10 (entget (car (entsel)))))

But i want the entity selected based on a previous slected point. So for example when i selected pt1 (which is a point at the border of the dynamic block) i want to be able to extract the base point on the block whit this point.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Conversion Of Base Routines To Diesel MACRO Based Routine

Jul 3, 2012

" Convertion of AUTOLISP base routines to Diesel MACRO based routine to be used in a AUTOCAD LT based platform "

Here i am attaching the lisp file for ready reference.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Interacting With Excel - ExportAsFixedFormat

Aug 17, 2011

I wasn't able to find out any information on what format the parameters are required to look like when passed along with the Method ExportAsFixedFormat.

I'm currently using the following code to change the active printer followed by the printout command
 
(vlax-put-property XL "ActivePrinter" "DocuCom PDF Driver on Ne03:")(vlax-invoke-method XLS "Printout")

 where XL is my spreadsheet and XLS is the active worksheet.  This works but the printer controls filename and location.
 
(vlax-invoke-method XLS "ExportAsFixedFormat"

 I've found the ExportAsFixedFormat but can not find any documentation that shows how to format the parameters within LISP to send to Excel.

The object browser for VBA in Excel shows the following:
 
Sub ExportAsFixedFormat(Type As XlFixedFormatType, [Filename], [Quality], [IncludeDocProperties], [IgnorePrintAreas], [From], [To], [OpenAfterPublish], [FixedFormatExtClassPtr]) Member of Excel.Chart
 
I recording a macro and got the following that shows some additional information.
 
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _"C: est.pdf" _, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _:=False, OpenAfterPublish:=True
 
Is there any documention showing what this looks like when using the vlax-invoke-method?

View 3 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 :: 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 :: 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 :: Import From Excel Or Notepad To DWG

Sep 5, 2012

I have some coordinate in the excel file. How to import from excel to dwg. All coordinate i will make polyline. I know one method all coordinate copy and paste to command prompt. But i need script file or other method.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Drawings From Excel

Dec 16, 2011

This probably isn't the correct discussion group but not sure where else to post this. 

My sales department wants to be able to create drawings based on entries in selected in their Excel qouting tool.  Basically, they want to configure a product in the field, and be able to show the customer the drawing with TrueView. (They don't have AutoCAD installed).

I would think the best I can do, is manipulate a .dxf file based on their selections but that may get very complicated.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Text To Excel

Jun 14, 2009

how create lisp convert text (from drawing) to excel

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Post HOSTNAME To Excel

Aug 26, 2013

Lisp routine that can write to an already existing XLS file?  What i need is an Excel file that will be updated with a users 'hostname' when they start AutoCAD.  I can get the hostname information with the below code, but I'm not sure how to get this value into an Excel file.

(getenv "computername")

Factory Design Suite Ultimate 2012
AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Call Excel Macro

Nov 10, 2012

i want to call an excel macro from a lisp. is it possible?

now i have this:

(startapp "C:\Program Files (x86)\Microsoft Office\Office12\Excel.exe"
    (strcat """
     (getvar 'dwgprefix)
     (vl-filename-base (getvar 'dwgname))
"XXX.xls""
)
)

i just want it to run macro1 from book1.xls

View 2 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 :: Find Cellname In Excel

Jun 25, 2012

I would like to get the cell with a specific name in Excel.

In Excel you can give a cell a custom name like "Project_Name".

How do I get the sheet and cell(row,column) of the cell with this custom name ?

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Exporting Text To Excel

Jan 24, 2012

I am trying to export what looks like a table of text to Excel. The problem I have is the table is not an actual TABLE within AutoCAD but rather just columns of text with lines drawn around it. How I can grab this text and then put it into an Excel Spreadsheet.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Larger Routine To Create And Rotate Text Based On Object Selected

Dec 29, 2011

the expression in question is part of larger lisp routine to create and rotate text based on the object selected and the viewtwist variable (we use dview twist to rotate our views when needed)

So the expression in question:
(< (/ pi 2) ang (* pi 1.5)
where ang is the total angle used to determine proper rotation of the text.

Now the problem. In most cases where ang = 90 (or 1.5708 radians) this works fine. the two exceptions i have encountered

in testing are a line at 70 degress, viewtwist 20, and line at 50, viewtwist 40. For whatever reason at these two conditions the expressoin evaulates True instead of nil and rotates the entire text object incorrectly (180 degrees). So question is how exactly is this being evaluated? i know its comparing ang (* pi 1.5) to (/ pi 2). is there some sort of rounding error? or maybe the expression needs a wee bit more definition? attached image and full lisp routine for reference of what is happening, blue text is angle of the line as created by routine at viewtwist 0.

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







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