AutoCAD Visual LISP / AutoLISP :: Field Update Customscale Viewport

Feb 22, 2013

I'm trying to create a field in a block (titleblock) that will automaticly update when I change the viewportscale.It's mostly only 1 viewport, sometimes a second of even 3rd but, they are not important to the titleblock.

I've read aboud fields and diesel expressions. I've tried and it works. there is only 1 problem,It only works with the object (when field expresssion, object, custom scale) in this case the viewport pressent at that time. 

When i use the same field with the same expressions, it does not recognize the viewport/object.Is there a way to make the field, diesel expression or even something else, work without it's need for a

object name. Perhabs that the expression gets the viewportname from a lisp, something like: (setq ss(ssget "X")) ;some thing like this Can it be done?

View 8 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Using Formula Within A Field

Apr 11, 2012

I am currently using a field for my elevation tags. The field reads the y-value of a line and displays the results as the elevation. Our local jurisdiction requires that we list elevations from above grade (A.G.L.) as well as from bottom of base plate. The difference is usually 6"-12".

I was wondering if I could create another field that would read the same y-value of a line, but then subtract a predetermined value (6") and display the results.

Currently we have to do the math ourselves and this leaves room for errors and is often very tedious.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Read Attribute Value Which Is A Field

Dec 15, 2011

(cdr (assoc 1 (entget (entnext (car (entsel))))) ...

gives the string value of the attribute, but i would like to retrieve the field value attached to that attribute.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Conditional Statement In Field?

Aug 19, 2013

I created a block, that uses the Y coordinate of the block and returns it's location in a field.

I would like to be able to indicate weather the value is negative or positive. If Y coordinate is less then 0, then the field indicates "-" in front of the value. But if the Y coordinate is positive, I couldn't find a way to place "+"symbol in front.

Is there any way I could introduce a conditional statement saying: if Y>0 then add "+" in front?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Field To Text

Aug 1, 2006

What is the Command that Converts a Field to Text so that I can stop a Field updating after the initial set-up? I need to apply this in lisp.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Field Formulas From Sheets Set?

Dec 6, 2013

I had a routine that extracted field values from text and atts, but noticed this morning it did not work on fields from sheets sets.

I looked at the code and realized if a field formula is beyond 256 chars, the dxf codes store it in multiple groups.

Here is the revised code that deals with thos multiple groups (3 and then 2):

;GET LIST OF TEXT AND FIELDS FOR A GIVEN TEXT;RETURNS ("PLOTTED BY " "%<\AcVar Login \f "%tc4">%" " DATE" ...);FIELDS START AND END WITH WITH %< >%;(TXT-FIELDS-SEPARATED (car (Nentsel " Select Text, MText or Attribute: "))) (DEFUN TXT-FIELDS-SEPARATED (ENAME
/ DICT ELIST ENDINDEX FIELDS FLDDICT FLST FORMULA INDEX OBJ SPLIT-FLDS TRIMMED-LIST TXT-LIST TXTAFTER DENT FLDVAL FLST-TR) (SETQ ELIST (ENTGET ENAME)) (COND ((OR (= (CDR (ASSOC 0 ELIST)) "TEXT")

[code]...

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Link To Layout Tab

Dec 5, 2007

Is there any way to grab the Object ID or name from a layout tab to use in a field? I wish to link the layout name to a callout block so that if the layout tab changes position and name (inserting a new tab), the call out block will update no matter what page it is on. Without using the Sheet Set manager.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Parsing In Field Formulas

Nov 3, 2011

We use Sheet Set Manager fields to keep track of section cuts and details and such.Users are asking me if they can get only the last 4 digits of the sheet number to show up on the section cuts.

Is there a way to parse or truncate a field in the formula area of the field dialog box?I'm familiar with LISP and DIESEL but the file dialog box / formula area does not seem to accept those functions. Will it take a .NET function? If so, what? Or, is there another option I'm overlooking?

View 2 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 :: Turn On / Off Annotative Field

May 17, 2013

When a text is selected, in properties palette the Annotative field can be turned on/off  - how can i do it programatically?

activex doesn't not have a propertiy for it. i presume it is in xrecords but could not find it.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Make Sum Field In A Table

Jun 24, 2013

i have one table make which field from block. Is  possible sum?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Field Formula In Attribute Value?

Sep 7, 2011

I am trying to put a field formula in an attribute value. Basically I have a block that has a attribute called QTY and it is equal to 1. I can get the object property to equal 1 with this expression:

%<AcObjProp Object(%<\_ObjId #########>%).Textstring>%

The expression above will show a value equal to 1 (as I would expect)

Lets say I have two blocks now and I have the lisp routine combine the field values to get the expression below.

%<AcObjProp Object(%<\_ObjId #########>%).Textstring>%+%<AcObjProp Object(%<\_ObjId #########>%).Textstring>%

In the attribute dialog box it will show 1+1 instead of 2. My question is how do I get it to show 2 with out opening the formula box and evaluating it?

I have also tried.

%<AcExpr(%<AcObjProp Object(%<\_ObjId  #########>%).Textstring>%)+(%<AcObjProp Object(%<\_ObjId  #########>%).Textstring>%)>%

and

%<AcExpr((%<AcObjProp Object(%<\_ObjId  #########>%).Textstring>%)+(%<AcObjProp Object(%<\_ObjId  #########>%).Textstring>%))>%

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Edit Format Of Text Field

Aug 7, 2013

I have many texts fields in my drawing. I need edit the format of all field. e.g field - 1030.60 convert to - 1.030,60 Is there any lisp doing that? I mean, select multiple field and change it.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Next / Previous Sheet Number Field

Sep 21, 2006

The Field dialog box has an item for CurrentSheetNumber with field expression: %<AcSm Sheet.Number>%

Is it possible to create a Field to display the Next Sheet Number (CurrentSheetNumber + 1) and a Field to display the Previous Sheet Number (CurrentSheetNumber - 1)?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Make Attribute / Field In Template

Jan 17, 2013

Is it possible to make an attribute or a field in a template with page numbering for layouts? Is it possible to make an attribute or a field in a template with the name of the layout?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Use A Field To Display Text Information

Sep 14, 2011

I have a situation where I have a AutoCAD table linked to a Excel table to retrieve lots of general information for a standard drawing. That works just fine. In additionally I can use the fields "formula" field name and select a cell in the AutoCAD table to pull the data from the cell to the field, and this works for table cells that are numeric, but some of the cells are text based, and for these situations AutoCAD simply gives me the #### result. Is there a way to use a field to display text data from a AutoCAD table Cell?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Tie A Key From Custom Dictionary To Display In Field

Sep 16, 2013

How I can tie a key from a custom dictionary to display in a field?

I know that I can dump the custom dictionary into global and the fields can track those values, but instead of strangling my available memory I'd rather track the dictionary key directly. How can I utilize the Entity name or the actual dictionary name & key?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Object Attribute In Xref?

Oct 19, 2011

Is there way get field object att in xref ?

View 3 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 :: Send Field Value To Multileader With A Block

Dec 10, 2013

I'm trying to send field value to a multileader with a block. I tried:

(VL-CMDF "_.mleader" (getpoint "
Specify leader arrowhead location: ") pause "%<AcVar.17.0 Lisp.*granitelbl* f "%tc1">%")

Maybe it was a naive of me to charge in so boldly. The field appears to have made it in but it does not act like a field and does not reflect the correct value or update. In fact I get no response at all. In fact using "update field" "all" selects the fields but reports that they are locked.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Field Expression of Attribute In Block

Mar 8, 2012

Is that possible to have a lisp to extract the Field Expression of a attribute in a block?Specifically, to extract the property VALUE (TextString) of this attribute.After to extract, I would like to put this text extracted in a different layout tab, in the same drawing. In this way, I will have a text linked to the attribute value between two layout tabs. So, when I have to change the attribute value, the text will be updated automatically.

I know that if I use the FIELD command to manually copy and paste this value it will work, but when I have a lot of attributes it becomes very laborious.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Default Formatting For Field / Object-Polyline-Area

Aug 10, 2012

I create a lot of fields that reference a polyline area and I'm constantly having to change the default formatting values. I would like it to default to an Architectural format, WITHOUT the appended "SQ. FT." (which often takes up too much space), with a precision of 0 and using a comma as the Thousands Separator.

Is there any way to set these default values?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sheet Setup - Rename / Renumber Additional Field

Dec 27, 2013

How to add the sheet description field into the rename & renumber window? I ask this because during the sheet set-up process we use the sheet description often, and I would like to go from sheet to sheet without having to right click and edit every sheet.

Civil 3D x64 2012
Win 7 x64 Ultimate
I7 3820 (3.6ghz quad core with HT)
32gig RAM (Corsair XMS3 4x8g)
Intel x z79 mobo (BOXDX79TO 2011 socket)
Radeon HD 7850 2gb GDDR5

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Regen Viewport

Jan 2, 2000

I'm trying to regen a viewport with Visual Lisp, with this code

(setq acadobject (vlax-get-acad-object))
(setq activedocument (vla-get-activedocument acadobject))

when I issue the next code

(vla-regen activedocument acActiveViewport )

I get the following error

*** ERROR: AutoCAD: AutoCAD is currently busy.

What is missing in my code?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get Viewport Scale

Feb 2, 2012

I am adapting a routine by Alan J Thompson found here for placing an outline of a paperspace viewport in modelspace.

I have added some lines for making a suitable No plot layer with appropriate linetype, and wanted to make the lwpolyline have a thickness dependent upon the viewport scale.

My paperspace viewport scales are set for printing via Zoom - 1/50XP for example to get a 1:50 scale plot (or 0.02XP)

Having selected the relevant viewport, I wanted to be able to determine the vp scale, but am unsure how to extract this information from the viewport entity itself.

The routine was as follows:-

(defun xpfact ()
(- (car (trans '(1 0 0) 2 3))
(car (trans '(0 0 0) 2 3))
)
)
--

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find One Of Corners Of Viewport Outline

Feb 2, 2012

Further to my earlier topic for getting the viewport scale which has been nicely solved, I am looking for a way to get one of the corners of the viewport outline 'drawn' in modelspace so that I can add the name of the spcific layout Tab to which it relates in a location that suits the drawn outline.

The code that I am adapting came from the thread titled Outline projection all viewports to model..The routine appears to pick up the corners of the viewport in paperspace and tranform/translate them to modelspace co-ordinates.

  (defun _trans (p) (cons 10 (PCS2WCS p ent))) (defun _cornersFromBBox (o / a b) (vla-getboundingbox o 'a 'b) (setq a (_trans (vlax-safearray->list a)) b (_trans (vlax-safearray->list b)) ) (list a (list (car a) (cadr a) (caddr b)) b (list (car b) (cadr b) (caddr a))) ) (if (setq ss (ssget '((0 . "VIEWPORT"))))
[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check To See If VIEWPORT Entities Are In Selection Set?

Nov 19, 2013

I have redined AutoCAD's copy command alias to C, but to also do other things, like set a few important variables in the background.  One of the lisps I've incororated are making new viewports, that also create layers that are visibly specific to the viewport being created.

We were tasked a while ago to do an easy job of copying entities (dimensions, text and what not) in a layout.  The problem is, users are copying the viewports too, which is bit more ineffificent than using the create viewport command I developed.

Is there a way to see if a selection set includes (0 . "VIEWPORT") entities?  If the check returns nil, well then all is good.  If the check returns "true", then I can prompt the user that a "VIEWPORT" entity is selected.  I can then exit the command, or ask the user if they are sure they want to copy the "VIEWPORT" entity.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert New Border - Create Viewport

Jul 8, 2011

I have a series of drawings that are currently in modelspace. What I have to do is

1) Insert a new border in paperspace.
2) create a viewport and place the view in modelspace into it.

I am trying to use the command -vports but get an SPPROCESSQUEUE error wghen I use lists such as this:

(command -vports (list 0.625 23.59375) "" (list 35.4375 2.625) "")

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Block Attribute With Variable

Mar 8, 2013

I would like to create a lisp that does the following:

Update a titleblock attribute with a $variable.

The titleblockname is variable / not static.

The attribute is not variable / Static, DW_SCALE

The titleblock is always places on the same layer, BL$4----

The (custom)-plotscale is stored in the $var "gvpsc".

I've tried to ajust the following lisp code. But I couldn't extract the part I need.

The problem is, the code checks all the layouts and updates all the titlblocks one by one.

Truely a good code. 

The only problem is, I don't have multiple layouts and I have a variable titleblock name.

Here is to code i've tried to convert to something I could use.

(defun C:UPD-DPC () (setvar "cmdecho" 0) (setq blkname "DPC-STEMPEL");(getstring "
Enter the name of block to update: ")) (setq att1 "DW_DATE");(strcase(getstring "
Enter the name of the attribute to change: "))) (setq newatt (strcase(getstring "

[Code] ....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Several Similar Drawings Through BAT File

Feb 7, 2013

i am working on writing a lisp to update several similar drawings through a .bat file.  One of the things i would like to do is to automatically increase the revision number by one.  I have figured out everything except how to select the text.  Looking at the database, the coordinates for the revision number are (10 15.2908 0.0295 0.0).  However, (setq a (ssget "x" '((0 . "TEXT,MTEXT")(10 15.2908 0.0295 0.0)))) returns nil. 

If each drawing's revision number is not in the exact same location, is it possible to select by a range of coordinates?  Using (getpoint), the range is from (15.5 0.0 0.0) to (15.1805 0.1409 0.0).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Custom Drawing Properties

Oct 1, 2012

how to access custom drawing properties using LISP.  It was in a discussion initiated on 01-06-2011, subject:  Custom drawing properties.

One solution was to use the following method:

(setq  si (vla-Get-SummaryInfo (vla-Get-ActiveDocument (vlax-Get-Acad-Object))))
(vla-GetCustomByKey si  "DWGPROP1" 'pval)
(princ pval)

Now taking it a step further, using LISP, how can I "update" my custom drawing properties?

Inventor RS 2011
AutoCAD Mechanical 2011
ASD 2013
Vault Collaboration 2011
Windows 7 Pro

View 2 Replies View Related







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