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


ADVERTISEMENT

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 :: 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 :: Block Insertion Routine Based On Block File Name

Apr 5, 2013

Create a routine that looks for a block based on a portion of that block name, using a specified path or search path. 

For example, block to search for is BLOCKABC123, so if someone inputs ABC or 123 as a block name, it will locate that block within that folder and inserts it into the drawing at a user specified location.

Ideally, if there is a check in that if it finds more than one match, then perhaps it flags or prompts you to choose 1, 2, or 3 option which block to use.  But I can live without this special function if it requires too much time to code.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Diesel Expression To Get Attribute Value?

Jan 12, 2012

I have a multileader balloon that I want to have a field that is a diesel expression that will allow me to select a block and extract the attribute value within that block. Is there anyway to do this?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Updating Old Routines?

Oct 14, 2001

I have a routine I wrote years ago for R12 and it worked fine. Now when I try it in 2000 it freezes Acad when I select the first button. The routine is for structural steel members and the idea is to select a country of origin which brings up a list, then select a section type from the list which brings up another list of all available sizes. You then select the
size member you want then insert it into the drawing. There is also an option to explode the block on insertion. If I remove the (set_lista) section from the following line it doesn't freeze.

(action_tile "AUS" "(setq sectype AA)(setq Country 1)(set_lista)")

(set_lista) is a selection of lists, the list to use is determined by the variable "sectype".

I can select the country I want then cancel the dialog box and type (set_lista) at the command line then reopen the dialog box and the list is refreshed. Just won't do it automatically.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Of Routines With DCL Files

Aug 8, 2012

I have writted a set of lisp routines with dcl files that I have implemented in most versions of Autocad since release 14. I can install the toolbars in Autocad 2013 but when I try to execute on of the commands, either by toolbar icon or command line, I get the message "Unknown Command".

I have added the appropriate paths to path list.

Dell Precision M4400 Laptop

Vista Business

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding / Subtracting In Diesel Expression

Nov 14, 2013

I have been asked to make the title text larger (drawing are being issued at 1/2 scale, A1 to A3) on a large set of drawings. My solution was to copy the title attribute block to a temporary location, resize the attributes and redefine the block by running a script (scriptpro). Some drawings needed the title line split to next line so I had to move the sheet counter (1 of xx, 2 of xx etc.) which was linked to drawing file name for number with a field/formula.

The diesel expression shown below extracts that number. My problem is I cant figure out how to I can edit this expression to allow for a set not starting at 1. I had used a formula to subtract the difference,but how do you express this to run in a script?

This is my script......

attreq
0
-insert
ftc-gwp-a1-nosheet-stb=ftc-gwp-a1-nosheet-stb
0,0
1
1
0
[code]........

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Diesel Expression In Field

Sep 2, 2011

If LISP can be used to edit a diesel expression in a field inserted in dtext?  I need to adjust the last number in $(+, $(GETVAR, USERI2),1) .

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Diesel Expression For Attribute And Dynamic Block

Mar 15, 2013

I have a task where I need to automatically insert the drawing number (no path), plus two additional items, one an attribute, the other is within a dynamic block. I can achieve this using fields but now I havce to truncate some of the text.

It seems like I can't edit if I am using fields and attributes/blocks can't be used in Diesel (correct me if I'm wrong)

This is the information I have:

Filename: 123456-AS-WE.dwg
Attribute: Q2
Dynamic Block: X1 - Additional Information

This is what I require: 123456-AS-WE [Q2] [X1]

This is what I have so far: 123456-AS-WE [Q2] [X1 - Additional Information]

In other words, I need to restrict the dynamic block field to the first two characters.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Merge Two Align Object Routines

Nov 23, 2011

I've gotten these two routines from different threads on here. One works with *text and blocks.  The second works with multileaders.

I'd like to merge the two so one command can work with a selection set of any of the above objects (assume selection set of mixed objects - some multileaders, some text, some blocks)
 
(defun c:at ( / ss ang *error*)(vl-load-com)(ErrorHandler '("cmdecho" "osmode"))(setvar "cmdecho" 0)(setvar "osmode" 576)(setqss (ssget '((0 . "*TEXT,INSERT")))ang (getangle "
Select two points along desired alignment:"))(mapcar'(lambda (x)(vla-put-rotation(vlax-ename->vla-object x)ang))(mapcar 'cadr (ssnamex ss)))(*error* nil))(defun c:test (/ ss ang i sset)(vl-load-com); Tharwat 17. 05. 2011 (if (and (setq ss (ssget ":L" '((0 . "MULTILEADER")))) (setq ang (getangle "
Specify Rotation Angle :"))) (repeat(setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (vla-put-TextRotation (vlax-ename->vla-object sset) ang)) (princ)) (princ))
 
Or see C:AT and C:TEST in the attached file

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating A Script To Run Multiple Routines?

Apr 17, 2012

I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines.  I have the 3 lisps working independantly but can't figure out how to get them to all run in one script.

Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks.  The last lisp locks all viewports in all windows.  I'll attach the 3 lisps I'm trying to merge in the script.  I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...

Here is what I have for the script file contents (which doesn't work):

(load "redefine100")

(load "redefine102")

(load "vlocker")

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automatically Installing Tool Pallets And Routines

Sep 18, 2012

We are working together whit another firm and we would like to share our tool pallets and lisp routines. The pallets and lisp files we would like to share are quite large so we would like to simply send them a USB stick whit all the files and a title "executable" program that automatically puts them on the right place and changes the appropriate information.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Stuck In A Routine 2?

Nov 21, 2013

Basically, the routine asks for the user to choose the hatch type (Retirer/Percer), then the layer (Defpoints/Select/Current) and finaly the type of the object to draw (Polyline/Rectangle). My original routine has also a Circle and a Boundary options, and an Error trap to reset the variables but I will keep it simple for the purpose of my issue. 

So, my issue is: when I choose the type of object to draw, it draws just one of it and the routine ends. I would like to have something that "says" to the routine that I want to keep drawing that object (Polyline or Rectangle) and putting the hacth inside until I do enter and then the routine goes to its end.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Force A Routine To Be Run

Dec 10, 2012

I have created an acad.lsp file in where I want to arrange all our company settings. I've stored it on the network to make sure everyone will use the same one and when updates take place I don't have to run past all pc's to change it. I've set everything in the deployment package but users can still change it when they reset their profile. Plus some pc's are already installed with AutoCAD before creating the lisp routine, how can I enforce the support directory to check on the network for the acad.lsp each time?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Selection Set For Routine?

Oct 16, 2013

with the mouse I can select objects on the screen and then start a command that uses these objects.

How can I perform this in lisp?

I can create my selection set, that's no problem, but how can I 'make it active'  for an external function?

(ssget "_C" p0 p1 '((0 . "TEXT")))
???
(c:txtexp)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Diesel Expression - Display Area In Square Feet Not Square Inches?

Feb 16, 2010

How I can update my diesel expression to display the area in square feet not square inches. See expression below.

^C^Cattdia;0;_-insert;AREABLK;1;1;0;$M=$(getvar,AREA);attdia;1

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Check Overlap

Aug 12, 2012

I want autolisp program to check overlap like in closed or open polyline with any other entity in the drawing, whether other entity is overlapping inside the polyline or not, i am beginner in autolisp and want to know exactly which functions are used or the program itself Also if possible to check circular overlap of one polyline with itself.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Rotating Lines

Jul 23, 2013

LISP routine for rotating lines so that text in linetypes always reads from left to right?

I use the QUERY command to create basemaps and often the lines that are imported read upside down or backwards or however you prefer to look at it.  Most often, if I look at the XY coords of these backwards lines, the End X coordinate is of a higher value than the Start X coordinate.

Looking for something that would compare the two X coordinates of a line, do some sort of an IF Start X > End X, and if its true, store the XYZ coords of the Start and End in some variable, and swap them.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Replace All Blocks

Oct 5, 2011

I am looking for a routine that will replace all blocks named "DgnMisc_nodepoleind" with a block named "DgnMisc_nodepoleind2" keeping the insertion point. I could use (command "-insert" "DgnMisc_nodepoleind=Y:/ACAD2007/DA settings/Library_new_scale1/DgnMisc_nodepoleind2.dwg" NIL ) but my problem is that the block I want to replace is used on two different layers and I only want to replace the ones on layer "TPSYM01".

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Page Setup

Jan 9, 2013

I found a lisp routine on the internet to change page setups on multiple layouts. The lisp worked but on some of the layouts it moved the viewport off the paper background (see attached). The layouts print fine but the only way to get the viewport back on to the background is to open the page setup and click modify, then ok and close. I tested this on a .dwg that I had saved to my computer rather than on one in  the main folder but I would like to do this to to all are maps since our IT decided to rename our printer and now all pages setups are no good.All I know about lisp is how to run one.

;; Copy current layout page setup to all layout tabs
(vl-load-com)
(defun c:CPS (/ Adoc Layts clyt)
  (setq aDoc  (vla-get-activedocument (vlax-get-acad-object))
 Layts (vla-get-layouts aDoc)
 clyt  (vla-get-activelayout aDoc)
  )
  (foreach
     itm
        (vl-remove (vla-get-name clyt) (layoutlist))
    (vla-copyfrom (vla-item Layts itm) clyt)
  )
  (princ)
)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Routine Into Fields

Sep 4, 2012

I have a lisp routine:

(defun getLayout (pos / result cLayout layouts^ i len)
; pos = -1 return previuous layout name
; pos =  0 return current   layout name
; pos =  1 return next      layout name
 (cond
  ((zerop pos)
   (setq result (getvar "ctab"))
  ); case

[code]...

which basically returns either the current, previous or next tab name depending on what you call up. Any way to link this lisp to a field? I am doing some plan and profile drawings which contain match lines I would like to have the match line text automated. For example if I'm on layout called PP02 there would be two match lines in the drawing one would read MATCH LINE PP01 and the other would read MATCH LINE PP03 this lisp routine returns the correct variable but how do I loink this to a fiels?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine During Batch Plotting

Jun 17, 2013

I cannot get my lisp routine to run when I batch plot in AutoCAD 2014.  It's loaded into the startup suite and runs when I open the individual drawings but not during a batch plot.  How can I get this to run during a batch plot?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Routine To Work In 2013

Oct 16, 2012

I don't do a lot of programming and when I do it is mostly with older lisp commands. I have routine that works in 2010 but we are switching to 2013 and it doesn't work. The routine assigns the area of a polyline to a field. The portion of the routine that isn't working is where it assigns the object id for the polyline. Here is that portion of the routine:

;; select an object
 (if (setq ent (entsel))
   (progn
     (setq ent (car ent))
;; Check to see if object selected is a polyline
     (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE")
       (progn
;; obtain the object id from the selected entity
         (setq objID (vla-get-objectid (vlax-ename->vla-object ent)))

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Share Routine On Server With Others

Oct 25, 2011

I have created a lisp routine that I would like to share with other CAD users, but it doesn't work on the server, and it works fine on my machine.  Does "findfile" function work on a server environment?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Rename All Layouts?

Sep 23, 2013

I am looking for a LISP to automatically rename all my layouts. I would like the first layout to say "HWY 400 (01)", second layout "HWY 400 (02)", third layout "HWY 400 (03)" ect..

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting A Contour Labeling Routine?

Jul 21, 2006

I need a routine that one can select a fence or a path along a whole lot of contours which are not in 3DPoly but rather a heavyweight POLYLINE and then have the Z value (elevation of this polyline) printed over the contour preferably along the direction of the vertex picked.

I have something right now that works by selecting individual plines but I need one you can select a whole lot and have the text inserted at the correct position.

See my simple code below:

;THIS IS FOR LABELLING 3D CONTOURS
(defun C:3DC ()
(graphscr)
(setq p (entsel "
Select CONTOUR to label: "))
(setq e (entget (car p)))
(setq e1 (entget (entnext (cdr (assoc -1 e)))))

[code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reload Routine For Every Drawing

Oct 16, 2013

I recently upgrading to ACA 2014. I have set my trusted locations, my file path, the startup suite, and the system variable to load acad.lisp on startup. Most of my lisp routines load, but not all. I still have my ACA 2011 loaded, all settings are applied as required, yet I do not have the same issue with the same lisp routines. I have to reload my lisp routines for every drawing.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Revcloud And Delta Routine

Jul 9, 2013

I'm trying to create a lisp routine where It will create a layer for the delta that is needed and at the same time adds the delta. I get delta revisions often and it takes time to add a new layer and a new delta for each plan. I would like to create a routine that creates the the new layer based on the revision number.

For example if I get a revision 2 I would like to have a lisp routine that creates a new layer but asks what number i would like to use, once the new layer gets created the revcloud command would run, I use polylines around my revisions then change them to cloud with the revcloud command. after i pick my polylines to be changed to clouds then it would add a delta block that is in an attribute and it lets me put the number of the revision i want. At the end I would have a new layer, a cloud around my revision and a delta corresponding to the revision number i'm currently working with.

I have a routine that creates the new layer, sets it current, and starts the revcloud command where i can pick the objects to change to clouds, after that I'm stuck, I'm not sure how to tell AutoCAD that after the selection is made to start the insert command to insert that delta attribute block. I mean the routine ends after i pick my objects, I tried doint the delta first but i ran into the same issue since my routine ends after AutoCAD ask me to pick a location to put my delta block.

I need to figure a way to tell AutoCAD that after something is picked or selected then to continue with the lisp routine without ending it. I atteched an example of what I have.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Rotate Text

Sep 18, 2013

I was wondering if there is a setting somewhere that could hold my snapmode settings after I use a lisp routine. I found a lisp routine to rotate text and have noticed that everytime I use that lisp command I lose my osnap settings....

View 2 Replies View Related







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