AutoCAD Visual LISP / AutoLISP :: Set Cannoscale By Selecting Dims

Feb 9, 2012

I am still green at lisp creation.  I would like to create a lisp to change my cannoscale to match that of an existing dimension in model space.  we use tabs and therefore have many different scales for the vports in our drawings.  i want to be able to type my command, have acad ask for a annotative dimension to match, i click it, then the lisp resets my cannoscale to match.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: CANNOSCALE / SCALELISTEDIT Creating And Setting?

May 6, 2007

I would like to be able to check if an Annotation Scale already exists and if it doesn't I would like to create it using the SCALELISTEDIT command and then set it to be the curent scale. I then plan to invoke the MLEADER command.

I do not want to have to rely on adding every possible scale in the list beforehand as my program would fall appart when a user decides to set an unusual scale I haven't thought of adding to the list.

See my initial start of the program.

(defun C:MLD ()
(command "cannoscale" "1:55") ;STOPS HERE WHEN 1:55 DOES NOT EXIST
(setq IfAnnoScaleExists (getvar "CANNOSCALE"))
(command "-scalelistedit" "add" "1:55" "1:55" "e")
)

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: CANNOSCALE Value Needs To Match Existing Named Scale

Jan 18, 2012

The crux of the matter is that the CANNOSCALE value needs to match an existing named scale.  This lisp is part of a bigger lisp and I need to pass a variable into it.  Here's what I have:

(setvar "CANNOSCALE" (strcat "1" = " (rtos variable 2 0) "'"))

But I get this error when I try to run it.

; error: bad argument type: numberp: nil

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Cannoscale Applies The Current Annoscale To All Objects

Mar 31, 2013

cannoscale applies the current annoscale to all objecs...i would like to apply it to specific objects? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting All On Layer 5

Mar 26, 2013

What a lisp routine would look like for selecting all items on layer 5. 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Multiple Objects

Nov 2, 2011

How to modify this routine so that I can select multiple objects as opposed to one at a time?

(Defun c:cd ()
(setq newdim (entsel "
Select Dimension to clear:"))
(setq newdimvalue " ")
(command "dimedit" "n" newdimvalue newdim "")
(princ)
)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Only Vertical Dimensions

Oct 25, 2012

The title says it all, Im trying to find a way to select just the vertical dimensions. Quick select doesn't work because there's no difference between a vertical and a horizontal dimension, so i was wondering if there was a LISP or something else i could do to accomplish this.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Text Strings Of The Same Value

Apr 22, 2013

A code that scans all through the drawing and selects the texts of the same value regardless of the layer, color, style, ...etc..

Just selecting duplicates for highlighting nothing more.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting File Location In Routine

Oct 19, 2011

I wrote this small program to automate plotting a drawing to pdf. Everything work fine except I cannot figure out how to allow it to let me pick where I want the file created and what I want to call it. In this routine, the "" at the 3rd from the end place will just automatically name the file and put it in the parent folder. If I replace the "" with pause, it lets me change the name, but will not let me choose the location.

What I'm looking for is for a dialogue box to pop up (explorer style) that will let me choose a location and name the file. This is what happens if you do it "long hand" inside ACAD, how to do it in the code.

(defun C:clpdf ()
(setvar "cmdecho" 0)
(setvar "osmode" 0)

[Code]....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SSGET For Selecting Multiple Objects

Nov 27, 2012

I have this code that I wrote years ago that I want to update to select two types of civil3d objects and show them selected with grips on the screen. This function works fine

(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))

but if I add the extra object like this which I assume is the wrong syntax i only get the second type of objects. Need correct syntax I should be using for selecting more than one object in an ssget statement.

(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE","AECC_AUTO_CORRIDOR_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)

(defun cF () (CELFEATURE))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting All Dynamic Blocks With A Pick

Jul 30, 2013

I used to have a lisp routine that would allow me to pick one dynamic block and it would select all instances including the blocks that have become anonymous. 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Object And Passing To VLA Offset

Feb 29, 2012

I'm trying to complete the code to select a p-line on layer G-POLY-GSF w/o asking for input. this (setq ent (ssget "X" (list (cons 8 "G-POLY-GSF"))) dosen't seem to work. What I'm I missing here?

(defun cf8 (/ ent dist obj)
(vl-load-com)
(setq ent (car (entsel "
Select line to offset: "))
;(setq ent (ssget "X" (list (cons 8 "G-POLY-GSF")))

[Code]....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Layer By Using Only Portion Of Its Full Name / Label

Jun 12, 2013

Ultimately I want to delete a bunch of Layers by selecting them using a portion of their name. Is there anything in cad that allows you to specifically select layers using only a portion of the layer name?

Based on AutoCAD Layer Standards: Users label layers with a code; for example: A-ANNO-TEXT

A - Stands for the Architectural Category the layer falls into

ANNO - Stands for Annotation

TEXT - Type of Annotation

I want to use the Layer Delete (-LAYDEL) command to delete all layers that begin with A-ANNO. In the Layer Manager (-LAYER) I am able to select specific layers using a " * " placed before and/or after " A-ANNO " to include all layers with that in its name.

When I write a script however (-LAYDEL); cad will ask me for the layer name, but will not allow me to use the *A-ANNO* to include all layers with that name: A-ANNO-TEXT, A-ANNO-GLAZ, A-ANNO-WALL, etc...

Is there anything in cad that allows you to specifically select layers using only a portion of the layer name??? I have to "taylor" drawings that I receive from companies who's layers may vary.

My script is in basic (NON LISP) language:

-LAYDEL
N
A-GENM
N
A-DOOR
N
A-DOOR-FRAM
N
A-DOOR-GLAZ
N
Y

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Constructing Infinite Lines By Selecting Objects?

Aug 12, 2013

Is there way that by selecting objects (Lines,Pl) it construct infinite lines ?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selecting Multiple Objects To Export Their Coordinates And ID

May 24, 2013

I am just starting learning lisp, And I am looking for a fast way to select multiple objects (usually circle) and export their coordinates and ID into a excel sheet through lisp programming.

As you might see in the attached drawing, the red circles are objects wanted. I have been trying to export their coordinates as well as their IDs in grids, e.g D28, Easting:  Northing:  . I still haven't found a good way to export ID for each circle.

As my code doesn't work, I wonder what's the most effective way to detect errors in lisp

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Continuous Dimension Lisp That Alternate Its Position

Jul 12, 2012

Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high?  If there is no lisp already created, how to create one? 

See Continuous dimension attachment for example.

I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

Nov 14, 2013

I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg").  how would i go about doing that using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Opening Drawings With Default Visual Style Set To 2D Wireframe

Oct 7, 2013

Is there a way to programatically set a visual style before a drawing actually opens?

We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings.  Some models will crash on some workstations when trying to open in a rendered mode.

I found a lisp with a function that looked to set viewport visual styles.  But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)

View 9 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 :: Visual Effect Settings?

Jun 20, 2013

Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combinations In DCL?

Sep 7, 2012

Is it possible to execute a certain command based on multiple selections withinin a dcl?  for example:  two radio colums, one with selections A and B, and a second with selections 1 and 2.  is it possible to program commands based on user selections from each column?  ex: if A and 1- do a command.  A 2- do a different command, etc...

I tried :

 (action_tile "key1" "(setq A t")
 (action_tile "key2" "(setq B t")

 (action_tile "key3" "(setq 1 t)(done_dialog)")
 (action_tile "key4" "(setq 2 t)(done_dialog)")

(if
(and (a) (1)
)
(command ...

but was unsuccessful.  no matter which combination was selected, the command under all combinations would run.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Attribute Value

Jun 3, 2013

I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 3D Point From X And Y?

Oct 9, 2013

I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).

Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me: 

node
of #<variant 8197 ...>

Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Point At Each End Of Arc?

Dec 19, 2011

What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
 
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn

[Code].....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get The Value Of Attribute

Dec 30, 2011

Is there a quick way of getting the value of an attribute?

I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".

I just want to be able to quickly grab that value.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Of The Alt Key In A Macro

May 29, 2013

I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing.

I believe I need to  insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Toggle Between PS And MS

Nov 8, 2011

I upgraded from Autocad 2004 to 2012 recently and my lisp file doesnt work anymore.

what it's supposed to do is when looking at the layout tab that you want you can switch to the model space location of the same zoom as the layout tab without messing with the layout zoom.

(defun c:msp ()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command"view" "d" "tmp")
(setvar "tilemode" 0)
(command"pspace")
(princ "Click TWICE on desired VPORT: ")
(command "mspace" pause "view" "s" "tmp")(princ)
(setvar "tilemode" 1)
(command "view" "r" "tmp")
(setvar"cmdecho" cm)
(princ)
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DOS DIR Command

Oct 27, 2012

I need a program that simulate this DOS command: dir /on/b *.dwg >list.txt

it list all dwg files on current open dwg file folder and sort them and finally put them in a text file with list.txt name. something like thistype list.txt)

test1.dwg
test2.dwg
test100.dwg
test256.dwg
test1005.dwg

(sort alphabetically and logically) because of disabled DOS utility in my PC I need a pure lisp functions, I tried to wrote this program but I couldn't!!

(defun c:listMaker()
(vl-load-com)
(setq path (getvar "dwgprefix"))
(setq fn "list.txt")
[code]...

and also I need a append a string(='This Is EOF') in the last line of the "list.txt" file.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Z Value From Text

May 10, 2012

I have text objects with the same Z value and I will select as follows:

(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))

How to store this value in another variable "zvalue" to apply to:

(command "change" "select text objects" "" "_p" "_e" zvalue "") ?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: What Is Dot Net Equivalent

Oct 17, 2011

the following returns true since the @ symbol tests for an alpha character.. (wcmatch "S101" "@*").What is the Dot Net equivalent?

View 2 Replies View Related







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