AutoCAD Visual LISP / AutoLISP :: Alert When Xref Is Moved?

Jun 29, 2013

I'm new to the programming thing, and this one has me stumped.  We have a problem with people accidently dragging xrefs.  The simple solution would be to put all of the xrefs on a locked layer, but I was vetoed on this suggestion.  I've been trying to figure out if I can write a lisp that will do one of the following: Give an alert if an xref is moved.Not allow an xref to be moved.Tell the user when they open a drawing that an xref is not at 0,0,0 insertion point.

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Hyperlink In Alert Message?

Aug 7, 2013

Is it possible to include a hyperlink with an alert message. I'm not finding any information.

I already know about VLA-LAUNCHBROWSERDIALOG, but I'd rather not launch two dialogs if not absolutely necessary.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Alert Box That Takes User Input?

Jul 30, 2012

Is there a way to have an alert box pop up at a certain point in the code which gives the user a chance to cancel the LISP program and not proceed any further?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Text Justification Alert Message Not Working

Aug 28, 2011

lsp.I could not able to  find error.

(defun c:t5()
(setq entname (entget(car(entsel))))
(setq thjh (cdr (assoc 72 entname)))
(setq tvjv (cdr (assoc 73 entname)))

[Code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Alert To Overlap Dimension Lines?

Sep 9, 2013

Sometimes someone dimensions a floor plan and starts one direction and then "goes back " the other way over the top of the dimension they just placed, which causes the dimension lines to overlap, which in turn shows incorrect distances when viewing on paper. Any lisp routine that can alert you to the fact that there are overlapping dimension lines (not the extension lines) in a drawing by changing them to color White or something? I have pasted a routine that we use which changes all dimenions with "modified text" to color white. That way I can see if someone just typed in the dimension distance they wanted instead of what was actually there.

(defun c:dc (/ dim_length)
(setq ssmod (ssget "X" (list (cons 0 "Dimension")(cons 1 "~"))))
(if ssmod
(progn
(setq dim_length (sslength ssmod))
(command "Change" ssmod "" "P" "C" "w" "")

[Code] ......

View 9 Replies View Related

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 :: Change Xref Layer With Xref Name?

Jul 31, 2009

Is it possible to run a lisp which can extract all the xref names, make a layer with that name and then change the xref on the layer? I have got a similar routine from earlier posts but it doesn't work if any xrefs inserted in paper space (works fine on model space). could change this routine allowing to change the layer of xref in paper space too.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( )
(setq ss (ssget "x" '((0 . "INSERT"))))

[Code].....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Xref Reactor Object ID To Xref Name

Oct 2, 2012

I am using (trying to anyway) a :VLR-xrefSubcommandReloadItem reactor.  My only question is how to get the xref/block name from the 'reactor callback data' Object ID.

I am ultimately trying to pass it to (vla-get-xrefdatabase ....), but I cannot figure out how to turn the second parameter from the reactor callback data into something I can use - for example the second parameter returned may be "65" or some other number. 

Civil 3D 2011
Windows 7 x64

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mleader With Xref Name?

Jan 27, 2012

I am looking for some mleader customization.Basically looking for a mleader that will add an objects name(in my case an xref or block) in the text. Attached is a picture of our current process... nothing special. basically instead of typing in text we use the insert field. In the field dialog that opens we select "object" under Field names, then under object the type button is pressed to select object(in my case and xref or block) then under property the "Name" option is chosen. This will insert the xref name in the multileader. This is not terribly hard but am curious if I can automate and save some steps.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Xref Insert To 0,0,0

May 10, 2012

I can't seem to find the SYSVAR that controls insert to 0,0,0 instead of pick on screen..

Quad Core 2.3GHz Intel, 64-Bit, Win 7
16GB Ram, 2GB Graphics Card
256GB SSD

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing XREF Layers In DWG

Oct 1, 2012

How to edit this string so that it would change ONLY XREF layers in a dwg. to color 3 bylayer, and leave all of my additional layers in the current dwg. as is.

^C^Cchprop;(ssget"x");;color;bylayer;;-layer;color;3

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Renaming Xref Using Code

Jun 18, 2013

This lsp was passed on to me from a colleague but he doesn't know where he got it. It does a useful procedure of placing each xref, residing in the drawing, to a unique layer. The layer name is derived from the xref name. I would like to edit this to take only part of the xref name. This system I work with requires all files to have the job number as a prefix eg LE1399901_Contours.dwg, so the xref name would be LE1299901_Contours by default. I want to remove the first 10 characters to be left with "X_Xref-Contours" layer name using this code.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( / ss cnt xrs en ed bn xp xbn )
(setq ss (ssget "x" '((0 . "INSERT"))))
(setq cnt 0)
[code]........   

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: XREF Rename / Repath

Nov 25, 2012

what i would like to do is rename (externally) and repath about 4-8 xrefs in a drawing set of about 100 drawings. 

you may ask why? it is because we are trying to establish a template set of drawings for a civil design office. and when we start a new project, copy over the drawings to the relevant project folder, change the project number, run the script across the drawings and go from there. I've also tried this using the reference manager, but it doesn't work when you change the name of the xrefs (loses association)

basically i know if i could use a lisp i would run it using autoscript or something equal. All i need is to figure out the code to change the project number in the xref

for example

current - "xxxx-PN009999-aaa-00-survey.dwg"
change to - "xxxx-PN001234-aaa-00-survey.dwg"

from my research so far, the easiest way is to make a lisp with the following

-rename
b
xxxx-PN009999-aaa-00-survey
xxxx-PN001234-aaa-00-survey
-xref
p
xxxx-PN001234-aaa-00-survey
c:acadcivildummyfolderxref

If this is the correct code, do i have to rename the CAD xref files in explorer first?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Freeze All Xref Layers?

Apr 24, 2013

I have the following code that works, most of the time.  Actually, it works or completes itself all the time, but there is no "all encompassing" measures incorporated.

All of the reference entities, believe it or not, are on layer "0".  There are also some consistent layers, that you can see in the code below.  However, a user may create or even remove any layer in the reference drawing.  Therefore in my current drawing, I may have layers that are not frozen in the xref.

Like i said, the following code works, but not all encompassing.

(setq filename "7102-002-950 UC10-03")
(setq FreezePRD (strcat filename "|_PRD"))
(setq FreezeSLD (strcat filename "|_SLD"))
(setq FreezeBORDER (strcat filename "|0_BORDER"))

[Code] ........

I guess what I'm looking for is to freeze all layers that begin with "7102-002-950 UC10-03|".

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Xref Layer Color

Aug 14, 2009

I'm looking for a lisp that will change all the layer colors of selected xref by clicking the xref and select color from the color table palette. I have a routine that would change the layer color of a selected entity other than xref.

;;Changes selected object layer to a true color
;;of chose from a dialog
box
(defun c:cvc (/ ent ent_data rgb str objlay)
(setq ent
(entsel)
)

[code]....

View 5 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 :: Bind Xref Via ObjectDBX Without Opening

Feb 11, 2013

is it possible to bind an an xref via ObjectDBX without opening the drawing?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Nested Xref To Regular

Nov 7, 2013

Any routine or way to convert a nested xref to a regular xref?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selected Object Is In XRef To Highlight

Aug 15, 2013

I think there is a function that will cause the selected object that is in the XRef to highlight.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing XREF Layer Colors In A Tool

Oct 5, 2012

How to edit the string below so that it will ignore all layer names starting with "E-". I want to change all XREF layers in the current dwg. to 161 but ignore all XREFED layer names that start with E- such as E-lighting, E-power etc.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copying Layout Tab And Xref New Title Block

Apr 30, 2013

I need a routine that will duplicate the current sheet's Layout tab and content to the next tab, set it current, delete the titleblock (by name) on the new tab and reference in a differently named titleblock, 1:1, 0,0 onto the new Layout tab. I'll be running this in a batch script.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Color And Linetype Of Xref Nested Entity

Aug 22, 2012

I have a Lisp that I have been working on with some folks in the office, and i feel like i am close, but i am not getting the cigar. The idea would be to have the lisp allow the user to select a nested x-ref entity, and change the color and linetype of the selected layer, similar to the old "LAP" command (I know it is a dinosaur, but I still miss it). I seem to be doing swimmingly, code I have quasi-plagiarized. It seems to crap out where i try to pass the selected linetype back to the layer. I get the nastygram "Command: ; error: no function definition: GETLINETYPE" right after selecting the linetype from the dialog.

Code below...

x(defun c:CX (/ Sel EntList DataList cnt Num ClrNum EntData)
(if (setq Sel (nentsel "
Select object to change layers color and linetype: "))
(progn

[Code]...

HP Elitebook Workstation
Windows 7

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change (Reference Name) Of Attached IMAGE Xref TIFF

Feb 13, 2013

I am trying to write a LISP that does the following:

-Open drawing

-Saveas as NEW drawing based on certain criteria from DCL menu

-Deletes old drawing

-*THEN, if drawing contain attached IMAGE FILE (.tiff in my case)

-Rename image file and repath image file based on the new file name

I have gotten it to do all of this, except I can not figure out how to change the "reference name" of the attached image file (.tiff)

Is this read-only data? I can manualy change it under xref manager, so there should be a way to do it via code...

The closest I have gotten:

;;after renaming and repath image file...

(SETQ NAME2 (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4)))
(setq item (vlax-ename->vla-object (entlast)));convert to vl object
 (setq check (vlax-property-available-p item "Name" T));check if the entity can be updated
  ;if it can
  (if check
   ;change value to match
   (vlax-put-property item 'Name NAME2))

'Name seems to be valid w/ xref'd blocks but not xref'd/attached image files..

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open Xref In Selected Layout And Zoom To Match View?

May 28, 2013

I have used Autocad since 1991, and my current job required me to use Microstation. One feature I liked from Microstaiton is the ability to select and open an external DGN reference, and then match the view of the parent DGN. In AutoCAD, you can also select and open an xref, but the DWG opens to the previous saved view, and not to the desired view that matches the layout.

My thought was to experienting with lisp or scipt and export the "Viewctr", "Viewtwist" and "Viewsize" variables to a text file, then importing the text file and using the "Viewtwist" as my "SNAPANG" value, then "Viewctr" as my "ZOOM, CENTER" value, and finally the "Viewsize" as the "Enter magnification or height:" value.

But, alas, have no time, and not quite the knowledge to duplicate MicroStation's open-xref-and-zoom-to-view feature.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Allow User To Move Room Tag That Is XRef Into Discipline Specific Models

Jun 14, 2013

I am looking for an alternative to in place XRef Edit.

The third party software I am stuck with has disabled in place editing an Xref.

The specific application I need is to allow the user to move an intelligent room tag that is XReffed into discipline specific models. Disciplines are Architectural, Mechanical, Electrical..Etc. Each discipline has their own room tag and needs to move their own tag to a location that can be clearly seen on their finished plot. Xref edit in place is the perfect tool for this..But since the third party has disabled the command, I need an alternative method.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Link Xref Layer To Local Layer - Same Display

Feb 21, 2013

Possible to link an xref layer and local layer so they display the same (eg. sync viewport colour, linewieght, line type)?

I insert xref's for my base drawing but legend is on local layers and I would like to be able to ensure that the line colour and linetype always match...

View 4 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







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