AutoCAD Visual LISP / AutoLISP :: One Button Changing Text Base Point To Be Middle Center

Aug 23, 2011

how to make a toolbar button so that when i click it and select a few single text, it will automatically change the text base point to be at "MIDDLE CENTER"....

At the moment, i use to create a button with macro of  " ^C^C_text;j;mc "....But the problem is whenever i use this button, i still need to type "MC" at the command prompt.. How to make it so that after i click the button, all i need to to is just select the text..

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Draw Line With Previous Middle Point

Jun 5, 2013

why do not draw the line between ptm1 and pt3?

(defun c:PUNTOM (/ pt1 pt2 pt3) (setq pt1 (getpoint "
Initial point : ")) (setq pt2 (getpoint "
Final point : ")) (setq pt3 (getpoint "
Offset : "))(setq ptm1 (mid (pt1 pt2))) (command "_line" pt1 pt2 "")(command "_line" ptm1 pt3) (princ));;;;;;;(defun mid (p1 p2) (list (/ (+ (car p1) (car p2)) 2.0) (/ (+ (cadr p1) (cadr p2)) 2.0) ));;;;;;;;

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Invert Level Of Middle Point Of Arc?

Dec 5, 2011

I need one lisp to get invert levels, I am having Invert levels and cordinates of two points of an arc how can I find invert level of a point middle of tht arc?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Insertion Point Of A Block?

Feb 6, 2011

I have insert blocks in my dwg. It is the circle. While creating the block, i was just pick the point into the circle not exactly at the centre.

Now i want change the insertion point of the block at centre of the circle without moving the objects from the dwg.

Beacuse i had use block editor to change the insertion point. But after changing, all blocks were moved from the original position.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text In A Dimension

Oct 15, 2012

I want to override the measurement in a dimension with a string of text using a LISP command.

E.g.. "select dimension"

type new text for dimension

replace dimension measurement with new text. I can get the entity and its values, buy not sure which value to change for the "text override".

BTW Acad 2012.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Formatting Style Inside All Text Contents

Aug 4, 2013

I have inside every text,Mtext contents different text style like Arial_1 , Arial_2.

How i can give all the contents inside one style ? the normal procedure i will enter inside text to enter editing mode and changing text format style one by one. I  want it once.

I want to save my routing of entering every text to change its content text style.

(Notice:select all from outside without editing mode will not do the job)

View 2 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 :: Changing Text In Attributed Block

Dec 21, 2012

I am trying to speed up some basic drafting of text revisions. In the P (plumbing) we call out the fixture units for a water pipe, along with the fixture units, the pipe size changes.
 
Is there any way to add numbers in an attributed block? (I have a lisp that works on text & mtext, but not attributes)

1.1. Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size).  I would want it to only add the 1st text fields. [If possible then change the 2nd text field according to a changeable chart. (see #2)]

1.1.1.   This is how the block looks like: x (y")
1.1.1.1.   x could be any number from 0.5 – 10,000 (only using 1 decimal place, and only as needed)
1.1.1.2.   y could be any number from the following list: ½, ¾, 1, 1¼, 1½, 2, 2½, 3, 3½, 4, 5, 6
 
Is there a way like in excel that you can set up a formula that will give a numerical result depending on other input? Like pipe size that change depending on the number of fixtures. There would need to be two different formula, one for hot and one for cold values (The value would be set at the beginning of the job; typically these values would not change later in the job). This could be separate text or if possible using the attributed block as described in #1.

2.1.    Example: Like if you have a block with two attributed text fields, the 1st field {x} is a number (fixture unit), and the 2nd field {y} is a number (pipe size).  I would want it to change the 2nd text fields according to the value in the 1st text field. If the value in {x} is 0.5 – 1.0, it would result in ½; 1.5 – 7.0 = ¾; 7.5 - 17 = 1; 17.5 – 36 = 1¼; ect.

2.2.    In excel it would be =IF(x)<1,"1/2",IF(x)<7,"3/4”,IF(x)<17,"1",…{all #’s in between} …IF(x)>5000,"6")))))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Exporting Point Locations To Text File

Jun 8, 2012

Im trying to come up with a lisp that will export x and y coords to a txt or cvs file. However, I need the lisp to export in this format

Units       Inch
WPT      1     0     0     ( X=0 Y=0)
WPT      2     1     1     (X=1  Y=1)
WPT      3     2     2 

I need to be able to set my zero with move origin and the export the points.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Color And Width Factor

Sep 28, 2013

What is the best way to change the color of two pieces of specific text in lisp? I want to change where it says (strcase ln6) & (strcase ln7) to the color of green. I tried it a couple of different ways but I'm having some trouble. First I am setting the current layer with a color of blue. I am then running the text command a couple of times. I want to run the mtext command a couple of times but I want the text to be green & I want the width factor to be .85

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Color Of Text In Table Cell

Nov 23, 2011

The following snippit of code is changeing the color of text in a cell of an AcadTable.  It will set the color to an RGB value and works great.  But what if the color is a normal color 1 through 255 from autocad's pen table.  How would I set the cell text color?

(setq objColor (vla-getcellcontentcolor eVLAMT R C)) ;sets a Color Object, whatever that is
(vla-setrgb objColor RED GRN BLU) ;sets the new color of the Color Object
(vla-setcellcontentcolor eVLAMT R C objColor) ;sets that new color object to the cell

View 5 Replies View Related

AutoCAD .NET :: How To Capture Point Node Of Text Line By Middle Center

Sep 5, 2011

In AutoCad when the text is aligned with "Middle Center" has two points, but in C #, I only managed to capture one of the points using: myText_DBText.Position.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Substitute Text To Blocks At Point Location

Aug 17, 2012

i found this valuable script Lisp routine to insert blocks at point locations and want to modify it but i do not know much about lisp ...

what i want is :

1) script start and asks for a Block Name (in this case QPP1, QPP2, QS, QE, ect)

2) the user picks existing text  

3) the script reads the value existing on this text an put it in a variable

4) then erases the pre picked text

5) inserts the block chosen

6) changes block value to number value pre-read

since it do almost all steps except for step 3 and 6

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Editing Multi Leader Text Insertion Point

Nov 16, 2012

Is there a way to modify the text insertion point of multileaders using lisp? We have a problem with some of our multileaders getting a landing distance set to a negative value.  My lisp routine will correct these to a default value, but then the text jumps a bit.  If I could get the insertion point prior to changing the landing distance then I could restore that point after changing the landing distance.
 
;;-------------------------------------------------------------------------------------------------(defun c:zld (/ e th dogleg doglegllength sf ss c mlss mlcount) (setqss (ssget (ssget "X" (list (cons 0 "MULTILEADER"))))DWATxtHgt (getvar "userr1")sf 1dogleg (/ 3 32.0)th (if dwatxthgt dwatxthgt dogleg)c 0mlcount 0mlss (ssadd)) (IF ss (while (< c (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss c)) c (1+ c) ) (= (vla-get-ObjectName e) "AcDbMLeader") (progn;;change the dogleglength if

[code].......

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line In The Middle Of Four Lines

Aug 10, 2013

I need lisp that do a line between 4 lines. 

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Entity With Options To Type In Text / Pick Point

Nov 6, 2013

I am looking for some code that would allow me to select a MTEXT Entity - or other entity -  (as the DEFAULT option) but also to allow me to type in some text manually or to pick a point in the drawing. Something that would present the user with:

"Select an object or [P to pick a point]"  or

"Select MTEXT or [M to type].

I can write some code to type in text manually as the default option and get the second option to select entity using get string and then write some condition of if code but I don't know how to do it having entsel as default option.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Temporarily Reposition The Menu Bar From Top To Middle Of Screen?

Jan 1, 2012

have had the good fortune to have recieved a Christmas present (o.k. to myself) a new Dell 30" monitor with 2560 x 1600 resolution.

The only thing I am finding troublesome as you might be able to see by the attached screen shot, is that now my autocad menus are, as expected at the top of the screen.  This new size of monitor brings with it the problem that you now have to travel your mouse a great distance to reach the menu bar items.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reinserting A Standard Base Template For Layering?

Oct 28, 2012

creating a lisp or pulldown with some standard features in it.

what i would like to do is be able to quickly insert a template (layers/linetypes/colours etc) which is the same used in our initial drawing. I'm a big fan of constantly purging and auditing my drawings to keep them clean and in a previous workplace we had the ability to reinsert all the default layering.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Style Used By Table Style

Jun 29, 2012

I am looking for a way to change the text style used by a table style with Visual LISP.  So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style.  Is this even possible?  Code and results are below.

(defun DumpTableStyles ()
(setq dict (vla-get-dictionaries (vla-get-activedocument(vlax-get-acad-object))))
(setq TableStyles (vla-item dict "acad_tablestyle"))
(vlax-for TableStyle TableStyles
(vlax-dump-object TableStyle)
)
)

[Code]....

View 3 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 :: Changing String Of Text / Multitext / Dimensions To Another String

Nov 16, 2012

i failed to find one which would change string of a text to other for all types of objects. I mean it was usually either only multitext, or only text, dimensions or attributes.creating one which would change in abt 200 drawings:

-001

-002

-003

to:

-00001

-00002

-00003

in attributes, text, multittext, leaders, multileaders, dimensions..... at the same moment?

It is meant to be used in ScriptPro (by loading lisp in script).

If not possible, then can also open each file and run the lisp in each of them - still would save lot of time.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dialog Box Button

Feb 15, 2012

I would like to creat a dialog box with buttons or radio buttons to insert various blocks.  something easy to start the dialogue, push the button desired and my block or lisp is inserted or run. I have the dcl part figured out.  i'm not quite smart enough to get the lisp down.  is there a generic lisp that can reference a lisp command that i can alter or edit and add to?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Locking Several Layers With One Button

Aug 23, 2011

What the require setting to enable me to lock of several layer continuously when i click the "LAYER OFF" button at the toolbar? I wish to set to be like whenever i use the "LAYER OFF" command, i can direct just continue to click several layers for it to be turn off.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Ribbon Button - Custom Schedules

Feb 18, 2013

How to add buttons and create my own ribbon in AutoCAD, but now I would like to be able to have buttons for two different schedules that I have created. While I can have a button start the schedule command it won't automatically pick the schedule that I want it to create.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: DCL Radio Button Label Length

Jun 28, 2013

I am trying to revise an old dialog box so that I can add some new options but I'm finding it difficult to shorten the label for a radio button enough to get the box width to look reasonable. I read somewhere that Windows fonts cause the label lengths to hold extra space for each character. The webpage that I found this on said the solution was to make a new line for the label, which sounded great to me, but they did not tell how to do it. After much searching, I figured out how to add an additional line to the label, but my program now refuses to function correctly. I set the middle button before initiating the dialog in my lisp, but when I select a different option, the original button remains selected along with the user's choice. The program actually works, using the last button selected, but I really want the button to respect the pick by the user and deselect the default button.

This worked perfectly when I had only two selections, and it still worked perfectly when I added the third option, but it just doesn't like it when I try to add a new line for the long description in the middle of a radio column.

I'm barely functional with dialog boxes..

DCL in question:
:boxed_radio_column { label = "Location"; width = 20; height = 2; fixed_width = true; fixed_height = true; alignment = top; :radio_button{key = "sl-AD"; label = "Spring Lake Applications";} :text_part{label = " and Distributor Services";} :radio_button{key = "sl-BP"; label = "Spring Lake BP Systems";} :radio_button{key = "gr"; label = "Grand Rapids";} }
 
lisp has the following in this order:

load dialog - I have a loading function that works fine
(set_tile"sl-BP""1")
(action_tile"sl-AD"           "(TGW-Setup_01 $key)")
(action_tile"sl-BP"           "(TGW-Setup_01 $key)")
[Code] .....

Of course, these are just the pertinent sections of a much larger setup dialog, but I didn't think I needed to post all the functions that this program is doing, since you'd have a difficult time running this without my templates, printers and a number of support files.

Like I said, it seems to be choking on my adding :text_part {  Label = "      and Distributor Services";} instead of making this a single line of the label for the button above it.

Why does this cause the default radio button to stop releasing?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Tool Button Image Missing?

Jul 13, 2011

I added a couple of standard Autocad MAP tabs to a custom  panel and in my custom workspace some of the button images don't show up. If I go to the Planning & Analysis workspace, the images are visible, but in the custom workspace, all I get are clouds with a question mark.

I attached two screen shots.

Civil3D 2014 SP1
Win 7 Professional - 64-bit
HP Z400
Xeon W3550 @ 3.07Ghz
24GB of RAM
Nvidia GeForce GTX 760

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combined Commands In One Macro Button?

Jun 28, 2012

I am trying to create a short cut button with a macor code.

I want it to set up a new orgin and set a base point in xrefs i am creating

The commands i want to combined are the follwoing

UCS enter
3P enter
BASE enter

The macro i am using is the following

^c^c_ucs 3p \_base

but it wont run the base command after it finishes the 3P command

This is whats show up in my commands bar

Command: _ucs
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]
<World>: 3p

[Code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Making A Most Used Tool Button For Toolbar

Sep 22, 2011

I also note I could use excel but I have this thing where id like to have the lisp and AutoCAD run independent from other external programs.

I’m the CAD monkey at work and I’m given unbelievable autonomy to what I build (sometimes I confuse work with hobby) put all to one side. My functions often require toolbars with several buttons on them what I would like for one toolbar in particular is to make a most used function button. Better said a button at the beginning of my toolbar, which execute the most used button from within that entire toolbar.
 
The ideas so far is to add a write-line (append) function lisp for every button this would intern write a button codename/ reference example SNP for snap and SAV for save and so on. All easy I can do this.
 
What I’m having difficulty with is actually counting the instances of the most used button using lisp. At the moment I’m resorting to a vb.net program, which needs to be shelled first, to recalculate the whole list it works but is messy and quite patch worked. The highest instance would then be used to set a variable, which would be used as the command in the so-called “top 1 tool button”

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Loading Routine With Toolbar Button

Apr 19, 2012

I need to load a lisp routine by way of a toobar button. I do not want to use the appload dialog box.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add New / Blank Button To Custom Tool Bar

Apr 17, 2012

AutoCAD 2012

When I am in the CUI editor and I right click on a button in a custom tool bar, it gives me the option to "duplicate" or "copy".

But when I go to change the properties of the new button, it changes both the original and the new button upon "apply".

Can I just add a new/blank button? I've tried dragging a new command from the list at the lower left corner but it does the same thing. :?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Construct Wall Centerline In The Middle Of Wall?

Sep 13, 2013

i need a lisp that construct line between two lines of wall by selection called  (Wall Centerline)

i attach example of what i want assuming that i will often isolate wall layer in the project to facilitate the task.

View 3 Replies View Related







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