Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Odd Problem with Finding a Block

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
AR12
332 Views, 4 Replies

Odd Problem with Finding a Block

Ok so, I am involved in converting a whole bunch of our programs over to AutoCAD 2013 from AutoCAD 2011 and in doing so we have changed how we have our programs set-up including that we are switching to using the Bundle format. One of the programs I am having an issue with is trying to insert a block, but AutoCAD isn't able to find it, even though the folder that it's in is in the search path and I have the folder open in Windows Explorer and can see the file is there. Any ideas what the problem could be?

 

The below is what AutoCAD is telling me. I have the folder C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\lib\ open in Windows Explorer and can see bailstepdetailref.dwg is in the folder.

 

"bailstepdetailref.dwg": Can't find file in search path:
  C:\Users\AR12\Documents\ (current directory)
  C:\Users\AR12\appdata\roaming\autodesk\autocad 2013 - english\r19.0\enu\support\
  C:\program files\autodesk\autocad 2013\support\
  C:\program files\autodesk\autocad 2013\support\en-us\
  C:\program files\autodesk\autocad 2013\fonts\
  C:\program files\autodesk\autocad 2013\help\
  C:\program files\autodesk\autocad 2013\express\
  C:\program files\autodesk\autocad 2013\support\color\
  C:\Users\AR12\appdata\roaming\autodesk\autocad 2013 - english\r19.0\enu\support\color\
  C:\Users\AR12\appdata\roaming\autodesk\autocad 2013 - english\r19.0\enu\express\
  C:\Users\AR12\appdata\roaming\autodesk\autocad 2013 - english\r19.0\enu\help\
  C:\Users\AR12\appdata\roaming\autodesk\autocad 2013 - english\r19.0\enu\fonts\
  F:\utility\drafting\borders\
  C:\program files\autodesk\applicationplugins\fusionplugin2013.bundle\contents\resources\
  C:\program files\autodesk\applicationplugins\adam2013menu.bundle\contents\support\
  C:\program files\autodesk\applicationplugins\adam2013menu.bundle\contents\lib\
  C:\program files\autodesk\applicationplugins\adam2013menu.bundle\contents\support\icons\
  C:\program files\autodesk\applicationplugins\adam2013menu.bundle\contents\template\
  C:\program files\autodesk\applicationplugins\adam2013menu.bundle\contents\programs\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\support\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\lib\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\support\icons\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\template\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\programs\
  C:\program files\autodesk\applicationplugins\hazletonmenu.bundle\contents\support\help files\
  C:\na.valmont.com\utility\CADSHARE\Protected\Standards\AutoCad\Borders\
  C:\Program Files\Autodesk\AutoCAD 2013\

 

Thanks,
Adam Richardson

If needed: AutoCAD 2017 User using Visual LISP for editing LISP and DCL files
4 REPLIES 4
Message 2 of 5
pbejse
in reply to: AR12

if you type (findfile "bailstepdetailref.dwg") and its nil then its not in the SFSP or the current folder

 

 

 

Message 3 of 5
AR12
in reply to: pbejse

Here's what I get when I put that on the command line:

 

Command: (findfile "bailstepdetailref.dwg")
"C:\\program files\\autodesk\\applicationplugins\\hazletonmenu.bundle\\contents\\lib\\bailstepdetailref.dwg"

 

So if it can find it using (findfile) why wouldn't it be able to find it when it's trying to insert it?

 

 

EDIT: Fixed a typo, wouldn't originally was would but should definatley say wouldn't

Thanks,
Adam Richardson

If needed: AutoCAD 2017 User using Visual LISP for editing LISP and DCL files
Message 4 of 5
pbejse
in reply to: AR12

Not sure how you setup you program to look for a block, here's what i use

 

(setq BlockName
(if (not (tblsearch "Block" "bailstepdetailref"))
(findfile "bailstepdetailref.dwg")
"bailstepdetailref"
)
)

 

I apologize for running out on you.. i'll have a look see tommorow

 

cheers

 

Message 5 of 5
AR12
in reply to: pbejse

After seeing your code, I went back to my source code(well it's not my code but I'm the one making sure it works in 2013) and found I think where the problem lies, this is what I found when I search for bailstepdetailref.dwg:

(command "insert" "Templates/bailstepdetailref.dwg" "0,0" "1" "1" "0" "")

 

which I think is where the problem is. I'll try removing the Templates/ part and see if it works, but I'm thinking that's the problem. Thanks for the help in narrowing down the problem.

 

 

EDIT: Yep that was the problem. Thanks for the help pbejse

Thanks,
Adam Richardson

If needed: AutoCAD 2017 User using Visual LISP for editing LISP and DCL files

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost