AutoCAD Visual LISP / AutoLISP :: Get Filename From Outside The Search Path?

Jul 30, 2013

I'm trying to get the file name of a file outside the search path. Obviously (findfile) is not an option. The file location changes with each project so adding a search path is also not an option. I can get the path to the file but i can't seem to figure out how to get the file name. I can also get the first set of characters, as they are constant from project to project, it's just the end of the file name that changes. The file is always a PDF.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Using Multiple Search Path?

Dec 17, 2013

I'm using a Lisp which searches a certain folder and then updates all blocks, which are nested in that folder.

My issue is, that I'd like to use more than one folder on different path, where the LISP can search for this files. Is there a way to use multiple search path?

The code I'm using now to search for the blocks is: (setq dir "I:\AutoCAD Blöcke\Template\Support")

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Support File Search Path

Sep 18, 2013

Some of our 64-bit users lose their custom Support File Search Paths.

After reading about it, I saw that I could add them back in by putting

(setenv "ACAD" "S:\Fonts;S:\Acad2007\Hatch_Patterns;S:\Acad2007\Lisp;S:\Acad2007\Simpson\Menu;”)

at the end of acad2013.lsp.

1.  However, I get malformed string on input error in AutoCAD.

2.  My other question is do I need to list only the custom paths or all of the built-in paths as well?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Tool Palette Search Path Duplicating Entries

Jul 22, 2013

I used this snip it to add the path for network  tool palettes. It works but it keeps adding the same search path every time i open a new session of AutoCAD. The list keeps getting longer with the same information. Say you want to make sure your users all have a certain tool palette.

(setq tooldir "z:\1111\2222\test]" toolpaths (vlax-get-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath))(if (not (vl-string-search tooldir toolpaths)) (vlax-put-property (vlax-get-property (vlax-get-property (vlax-get-acad-object) 'Preferences) 'Files) 'ToolPalettePath (strcat (vl-string-right-trim ";" toolpaths) ";" tooldir) ))(setq tooldir nil toolpaths nil)

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Save Filename As Variable

Oct 20, 2011

how to write a lisp command, or function, that will save my newly created drawing with a file name is that is called up from a variable.

For example:

(setq filename variable)
(command "saveas" "r14" "filename")

and i would want the outcome to be:  variable.dwg, rather than filename.dwg. I have tried numerous different ways of doing this with command prompt and cant seem to get anything to stick.  Everything that works just creates a file named "filename.dwg", which is not what i want to do.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Text And Get The Filename Where It Occurs

Jun 24, 2012

Actually I am not a Autocad Lisp person but I need to refer Autocad drawing for my workflow.

Is there a way in Lisp to find a certain, text or attribute in all files in a folder and if the file

contains that text to get the filename written to a txt file.

Config :: Intel (R) Xeon (R) CPU E31245 @ 3.30 GHz, 16.0 GB, 64bit win7
Inventor 2013 and Vault Basic 2013

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Table Search With Wildcards?

Dec 9, 2011

any code that can search for a layer using wildcards?

In my specific case, I have multiple layers than begin with "MECA" followed by a job code. I'm trying to code something that will check to see which of those layers is on, then return the layer name.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Search A Block Quickly

Feb 2, 2012

to verify if a block exists in the drawing, use the following function, which for is too slow.Is there a faster way to search for a block?

(defun findblock (cerca / blk nomebl trovato) (setq blk (tblnext "BLOCK" 1)) (while blk(progn setq nomebl (cdr (assoc 2 blk)))(if (= nomebl cerca) (setq trovato T) ) ;-(setq blk (tblnext "BLOCK")) ) ) trovato)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Search For Existing MLeader With Attribute Value

May 21, 2013

I'm working out a LISP for searching my entire drawing for a MLeader with a given value and then do something if it is found.

Currently, my code dies with 

; error: Automation Error. Description was not provided.

I do not know what is going wrong & I don't know what must be done next.
 
(DEFUN ML-SRCHSTR (TXT LBL / SS n_txt_LBL ENT P1 P2) ;|(ML-SRCHSTR TXT)|; (IF (SSGET "x" '((0 . "MULTILEADER"))) (PROGN (SETQ ss (VLA-GET-ACTIVESELECTIONSET (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)))) (VLAX-FORent ss(IF (VL-STRING-SEARCH txt (STRCASE (VLA-GET-TEXTSTRING ent))) (PROGN (VLA-CLEAR ss) (INITGET 1 "Yes No") (SETQ n_txt_LBL (STRCAT "
=>> " LBL " Label EXISTS! Add another " txt "? ") y_n (GETKWORD (strcat n_txt_LBL " [Yes/No]: ")) ) (IF(= y_n "Yes") (PROGN (ppa-L-

[Code]...

My MLeader has a _TagBox & it is the attribute of the _TagBox that I am trying to check/compare the "txt" value.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Search And Replace Predefined Blocks

Jul 11, 2013

1) I want to search the drawing for the pre-define block names given in the program.
2) If the are there, I want to replace them with the new version.
3) Program replaces the first block it finds, then tries to insert that block.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Support File Search Paths In Routine?

Nov 8, 2013

I have a simple lisp routine that loads everytime one of my users opens a new drawing, It sets the printer paths, sets the template paths and sets a bunch of environment variables

One thing I would like to add to this lisp routine is the ability to add support file search paths.

Is there a simple setenv variable for this? or is it more complicated?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Search Database / Tables To Determine If New Layers Present In Drawing

Dec 6, 2013

Is there a way to search the database/tables/whatever to determine if new layers are present in a drawing?

I want to run a script to reconcile new layers in the sheet drawings after having cleaned the xref drawings, and the script bombs if there are no new layers present in the parent drawing.

If I could determine what triggers the layereval/layernotify sequence (tblsearch?) I could include an if or while lisp routine that would invoke the layer command and then reconcile the new layers.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SPACE In Folder Or Path Name

Feb 12, 2013

I'm try to write a list to produce a script file!I just want to insert a dwg file in current drawing.back to MS Windows, in case of having [space] in a folder's name, we should use "" marks:

CD "Program Files"; DEL "file 10.txt"; ....

I tried both with and without "" marks but I failed!I pasted part of my code below with result of each case:

(setq TBFile "H:z.autocadA1 A2 A3.dwg")
(write-line "-INSERT" des)
(write-line (strcat "*" TBFile) des); ; *H:z.autocadA1 A2 A3.dwg  <<=should be this
(write-line "0,0" des);;insert point
(write-line "1" des);;xyz scale
(write-line "0" des);;rotation
[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remember The File Open Once Or The Path?

Jul 4, 2012

like in AutoCAD there is REMEMBERFOLDERS can u tell me if i use syntax with getfiled and i want the path to be remember next time what should i do or what syntax i use for that.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Editor Path Shortcut?

Dec 10, 2013

Could a .lsp file work with the block editor so that double-clicking a block will make it skip straight to the editor without displaying the "Edit Block Reference" dialoge?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Path Of Added Item Is Too Long

Aug 2, 2013

Have issues with creating an AutoCAD deployment and "The path of the added item is too long" error message?

I understand that the paths are limited to 255 characters but I tried just a local path and I get the same error.

Under Additional Files in deployment options, I want to add 2 folders under <Installation Directory> and add 2 files under Support folder.

1st folder would be ARG folder for a custom profile xxx.arg file

2nd folder would be Template with a custom template xxx.dwt file

Under Support, I want to browse and add two files: custom accaddoc.lsp and enterprise acad.cuix file.

All of those files reside on a share drive but the paths are about 40 char so I'm way below the limit.

Every time I want to add a folder under <Installation Directory> I receive the error message: 

The path of the added item is too long: "Create New Folder" Please limit this path to -28 characters (currently 17).

So I copied all thos files locally but the same error show up.  Is this a bug?  I can't customize my deployment if those files are not available.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Renaming Relative Path Xrefs?

Oct 12, 2011

I have set up a master set of dwg. files we use to create our construction documents.  The files consist of a master file that xrefs base files.  All of our files are named using the project # first. (i.e. 2011001c.dwg).  I have set up the master set using x's to replace the numbers.

Here is how it works:

XXXXXXXc.dwg (master file) relative path xref's the following files.
XXXXXXXlw.dwg
XXXXXXXvlw.dwg
XXXXXXXeg
XXXXXXXfg
XXXXXXXtitleblock

note:  all of these files are saved in the same folder.

I am trying to find a way to keep the xref paths working when I copy the files to a project folder and rename the files using the actual job # insead of the x's as place holders.  As it is now, when I change the drawing name the reference is lost and I have to manually change all of the xref paths in the xref manager.  Is there a command, program, or lisp routine than can change the file names and update the paths automatically.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Distance Between Two Points Along The Path Of Polyline

Sep 10, 2012

There are times that I have a really long curb polyline that has both line and arc segments.  I wish to pick two points along that polyline and have it give me the distance between those two points along the path of the polyline.

Do we have this ability natively?  Have I been missing something all this time?  Normally I have to make a copy of the original entity, ... break, break, list erase or undo....

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Establish Network Connection / Path

Aug 22, 2012

Our I.T department uses kixstart to run a batch script every morning, which is supposed to establish a network connection. The connection is 9/10 times available. 1/10 times it fails and means that workspaces and other user defined settings are inaccessible.

Bringing up the issue with I.T seams to eparch on there skills as a professional so nowadays I tend to bring it up once maybe twice but then settle for ding it my self

So what I found out is the following batch scrip/ snippet is used to establish a network

net use P: \AutoCAD_2012-08-22

I could compile a batch and then launch it using a lisp for example

(command “startapp”….

Or

(command “shell".However this would be hakky and also requires two files (the lisp and then also the bat file, rather keep it simple just the one).Is it possible to establish this connection using lisp?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Path For Drawing Containing Block In Script File

May 27, 2013

I am trying to make a script for inserting a standard title block  in some drawings. ( which needs to be often done for different projects). The title block is kept in the network path. How can i specify the path in the script file in order to insert the block.

-Insert,> Block name > (I need to specify the drawing in the network to get the block in it) 

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Draw Walkway Path For A Roof

Jan 3, 2014

I do a lot of repetitive tasks in my daily drawings and I’d like to make life easier!  I was researching how I could write a lisp to draw a walkway path for a roof.  I came across a couple of interesting posts but couldn’t follow the code because of my lack of understanding the language. 

So what I do is draw a 30” x 30” square (using the rectangle command).  Then copy it so there is a 2” gap between them.  Then I go back and hatch them with a dot hatch scaled to 96.  What I’d like to do is type a command and it would draw the walkways for me and hatch them if possible.  The problem is the last one is a custom cut size depending on the length of the walkway run?

Now I know I can draw a line, draw the square, hatch the square, array it on the path with set distance between items, then fix the last one so it looks the way I want it to, and then delete the line.  But why do all that when I have a program that allows me to customize it to be done for me? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extracting HKCU Path From Unknown Version Workstation?

Jan 6, 2012

I have the following path declared for a R2007 workstation:

(setq rr (strcat "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R17.0\ACAD-5001:409\Profiles\" (getvar 'CPROFILE)))

How can I extract this path without manually declaring it?

Something like:

(VL-Get-Registry-Path-Prefix (getvar 'CPROFILE))

Which will result in the following statement:

(setq rr (strcat (VL-Get-Registry-Path-Prefix (getvar 'CPROFILE)) (getvar 'CPROFILE)))

Dyslexia is a permanent physical disability that cannot be seen.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Writing File Path To TXT File

Dec 20, 2012

I have a file path im trying to capture in a text file however its not working and autocad is prompting back,

; error bad argument type: streamp nil

 Im assuming its because of the slashbacks but Im not sure..

Hence the code so far...
 
(defun C:GO ()(SETQ ACADLSP (findfile "acad.lsp"))(setq f (open "C: est.txt" "w"))(write-line ACADLSP f)(close f))

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

Photoshop Elements :: Search For File With Part Of Filename In Given Folder?

Nov 23, 2013

How can I search for a file with part of a filename in a given folder?
 
Or can I change the columns in Advanced Search so that the heading is filename?

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







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