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


ADVERTISEMENT

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 :: 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 :: 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 :: Inserting With An Align Parameter

Jul 9, 2013

Using lisp to insert a dynamic block that uses an align parameter. I have a rather elaborate lisp program that I am adding to so that it can insert one of my library blocks which contains an alignment parameter. It sure would be nice if the alignment could be automatic and not involve additional user input.

What I am hoping for would be a way to allow the alignment parameter to do its job when inserting with the following line of

(command "-insert" BLK-N-PTH ins 1 1 rot)

I was catching the rotation value of a "parent" dynamic block by using vla-get-rotation and then correcting for UCS and converting form radians to degrees, and this works well for straight blocks, but some of my blocks are curves and the whole paradigm falls apart with then.

So far my workaround is to have the user also pick the rotation, which does seem to work:

(command "-insert" BLK-N-PTH pikpt 1 1 (while (eq (logand (getvar "CmdActive") 1) 1) (command pause) ))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Block With Attribute Value?

Apr 15, 2013

I started a lisp that moves blocks according to their attributes and align numeric value in x 0.0. I work currently selected point by point. I will wish it to run at once on a selection set (I am angry with entsel).

(defun c:test (/ sel ent st newpt)
(if (setq eset(ssget))
(progn

[Code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Geometry Within A Block?

Oct 5, 2011

What I am trying to do is figure out the steps to "reset" geometry within blocks. (Assuming rectilinear).

That is to say find the min X value and Y Value and align that with the 0,0 of the block. To be able to do this on a drawing full of blocks. Essentially fixing poorly defined blocks whose origins are miles/km's away!

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Align Block With Two Selected Destination Points

May 13, 2013

I am trying to write a program to align a block with two selected destination points. 
- first the user is prompted to select a lwpolyline of a block entity
- then he is prompted to pick two destination points

I face problem with the sub-routine SegmentPts. It is supposed to return the coordinates of two vertexes on both sides of the picked point on a lwpolyline using entsel. But here in my program, when i am picking a point using entsel on a lwpolyline inside a block entity, it is not returning the two vertexes on both sides of the picked point. In stead, it returns some other points of the selected LWPOLYLINE. Why it is doing so? Where is the problem in my program?

It works fine with my other programs where i pick on a LWPOLYLINE entity. In this particular case, the LWPOLYLINE is inside a Block entity and the program is not returning correct points.

Please check Lisp Program below:

(defun C:alb()
(setq ent1 (entsel "
Pick on one side of LWLINE ofa Block:" ))
(setq ent (nentselp (cadr ent1)))
[code]........

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Merge Layers With Wild Cards

Nov 10, 2011

I'm needing to merge a bunch of layers dozens of drawings. 

original layers..

A-CL-E
A-CL-N
A-CL-X

new layer

A-CL

now i have to go through dozens of layers. that have that same format..

i.e. :

layername1-E
layername1-N
layername1-X

merge to layername1

ideally, a routine that says all layers named LAYER1* MERGE TO LAYER1

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible To Pull Out Coordinates From Object When Object Snap Applied?

Aug 29, 2011

I have a rather simple 3rd party custom object... I tried to get its bounding box but the coordinates that come back don't seem to relate at all to the object.

What I'd like are the coordinates of two nodes the object contains...

Is it possible to apply the autocad cursor in some why with the node object snap to get their coordinates?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Current View Align With Current Ucs?

Jul 20, 2013

how can i know if the current view/display is align with the current ucs?

let's say i have rotate the ucs about z axis 45 degrees and make it plan now i draw some things and then i change back to world

worlducs = 1

viewdir = 0,0,1

ucsxdir = 1,0,0

ucsydir = 0,1,0

but the display is still in the ucs z 45 (ucsfollow = 0) set the view to PLAN current (now the view is aligned) but the system vars does not change.

For a plan UCS, you would need to compare the VIEWDIR system variable and the cross product of the UCSXDIR and UCSYDIR system varaibles.

[URL]

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Name To VLA-object?

Feb 21, 2013

I need to get VLA-Object from block name.

here there is a code to get block name from VLA-Object:

(vlax-get-property obj (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName 'Name) )

 but I need the inverse of this code exactly:

blockname(as a string)==>VLA-object

(defun GetVLA_BName (BName).......

so, how can I do it?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Flatten 3d Object To 2d

Mar 15, 2013

I am trying to write a simple (or at least I thought it was) code to flatten a 3d object into a 2d shape.  For some reason after ACAD runs the lisp it recognizes the flatten command but it will not select all.  this is what I have:

(defun c:fl () (command "flatten" "all") ) 

I have even tried the pick first command, to select all then run the flatten command but that still doesn't work. 

View 5 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 :: How To Fade Object (block) In And Out

Jun 24, 2012

How to fade an object (block) in and out?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Detecting The Object Name With A Reactor

Dec 9, 2011

i am trying to add a reactor to ddatte command,  would like to know which object was being edited, the ename or object name (ssget "P") does not seem to be the one

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mirror Object Automatically

Nov 10, 2011

I am looking for a lisp routine which will allow me to mirror an object that I pick automatically.  I don't want to have to pick the two points to set the mirror line.  I just want the point I pick on of the object I select to be the point of the mirror.  If that can't happen, I was wondering if the object could mirror at its insertion point (like if it were a block or a text.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Object Associated To A Field

Nov 1, 2011

We use multi-leader objects in our drawings. When the multi-leader and its value are to be replicated throughout the drawing, we create mleaders with fields that show the contents of the first mleader. That way we can update only the value in the first mleader and all of its children will update as well. It works nicely for us.

Here comes one snag. If one of us opens a drawing with which we are not intimately familiar, we don't know which mleader is the parent of which children. There might be fifty parents and four hundred children in a drawing so going through them by hand is a big productivity drain.

What I need to do is write a routine that will let the user select the mleader that includes the field and have the routine highlight and/or zoom to the parent object.

I thought I should be able to find that info in the dxf codes for the mleader, but I am either missing it or it's not there.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Object Using Entmake

Nov 12, 2013

I am creating a line using entmake, but I need the start and end point to be variable that was already defined  ex.

(entmake '((0 . "LINE")(8 . "FIELD") (10 . line_insert) (11 line_end)))

Command: !line_insert
(29.2813 20.5 0.0)

Command: !line_end
(29.2813 18.5 0.0)

The error I get is

; error: bad DXF group: (10 LINE_INSERT)

What do I do to make it recognize this variable?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Assign Reactor To Object?

Feb 7, 2012

I use the following code to assign a reactor to an object.

Now I noticed that if I close the dwg file after you successfully saved, when I open even if I load the lisp, the reactor does not work.

Another problem: when I use the command "erase" or "explode" the reactor is started twice, why? you can run it at once?

(setq marReactor (vlr-object-reactor (list (vlax-ename->vla-object oggmar)) "TEST" '( (:vlr-erased . reactor_upd) (:vlr-modified . reactor_upd) ) ))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Display Height Of 3D Object To 3 DPS

Jun 14, 2013

I have this lisp which will display the height of a 3D object to 2 dps. What I need is for 3dps to be displayed but I have no real understanding of LISP coidng so I can't work out where this is specified in the routine.

Why this LISP does not work when I try to use it in a drawing which has a Pointools POD file working (or previously had one) within it?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Object From Layout To Another Programmatically

Dec 14, 2011

how to do this programmatically and without modifying the handle of the object,i am trying to do it programmatically (entmod (cons 410 newname)(assoc 410 ... no luck.

(entmakex -ing will modify or create a new handle ctrl-X and then ctrl-V recreates a new handle too ...

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 :: Routine To Load Particular Object Snaps?

Jun 20, 2011

A lot of the LISP routines we use turn off all snaps except the "nearest" snap when the routine is complete.

I draw with 6 out of the 10 snaps on (not the nearest).

LISP routine that loads specific object snaps?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line From Origin To Object Centers

Jan 3, 2013

LISP routine which will draw lines from the center/insertion point of multiple objects to 0,0,0 ? 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Draw 3D LOFT Object?

Jul 21, 2003

Is there a lisp routine to draw 3D object by the LOFT way ? .

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Bad Argument Type / VLA-object Collection

Aug 6, 2013

I discovered yesterday my burst lisp routine isn't working. It gives the following error message:

bad argument type: VLA-object collection: #<VLA-OBJECT 0971e1d4>

The routine does not appear to have changed. But here is the
 
(Defun C:BURST (/ item bitset bump att-text lastent burst-one burst BCNT BLAYER BCOLOR ELAST BLTYPE ETYPE PSFLAG ENAME ) ;----------------------------------------------------- ; Item from association list ;----------------------------------------------------- (Defun ITEM (N E) (CDR (Assoc N E))) ;----------------------------------------------------- ; Error Handler ;----------------------------------------------------- (acet-error-init (list (list "cmdecho" 0 "highlight" 1 ) T ;flag. True means use undo for error clean up. );list );acet-error-init ;----------------------------------------------------- ; BIT SET ;----------------------------------------------------- (Defun BITSET (A B) (= (Boole 1 A B) B)) ;----------------------------------------------------- ; BUMP ;----------------------------------------------------- (Setq bcnt 0) (Defun bump (prmpt) (Princ (Nth bcnt '("
-" "
\" "

[code]....

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Why They Change Object Layer In Place

Nov 11, 2013

This is in regards to the LIP command in Toolpac. The layer properties for a selected nested object (LIP) used to default to nested. Now you have to select nested from the list of options. Why they would change LIP. My whole company had gotten so used to it.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extrude Object In Negative Z Direction

Jan 1, 2014

I am trying to extrude an object in the negative Z direction.

Easy to do at the command line by putting a "-" sign before the distance to extrude the object but I'm having trouble in autolisp.

Define points for polyline for valence

(setq p1v p1)
(setq p2v (polar p1 (DTR 0.0) box_width))
(setq p3v (polar p2v (DTR 90.0) val_thick))
(setq p4v (polar p1V (DTR 90.0) val_thick))

;-- Create valence polyline

;-- Draw the polyline for the valence
(command "pline" p1v p2v p3v p4v "c")

;-- Assign the new part a variable name
(setq cab_valpl (entlast))

THIS IS THE PART I'M TRYING TO FIGURE OUT BELOW ....... WHAT IS THE SYNTAX TO EXTRUDE "VAL_HT" IN THE NEGATIVE DIRECTION?

;-- Extrude the polyline to make the valence
(command "extrude" cab_valpl "" val_ht "0")

View 6 Replies View Related







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