Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
AR12
Posts: 90
Registered: ‎12-28-2009
Message 1 of 5 (187 Views)
Accepted Solution

Odd Problem with Finding a Block

187 Views, 4 Replies
10-09-2012 07:41 AM

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 2013 User using Visual LISP for editing LISP and DCL files

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

*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 2 of 5 (184 Views)

Re: Odd Problem with Finding a Block

10-09-2012 08:02 AM in reply to: AR12

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

 

 

 

Valued Contributor
AR12
Posts: 90
Registered: ‎12-28-2009
Message 3 of 5 (178 Views)

Re: Odd Problem with Finding a Block

10-09-2012 08:05 AM 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 2013 User using Visual LISP for editing LISP and DCL files
*Expert Elite*
pbejse
Posts: 2,500
Registered: ‎11-24-2009
Message 4 of 5 (172 Views)

Re: Odd Problem with Finding a Block

10-09-2012 08:15 AM 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

 

Valued Contributor
AR12
Posts: 90
Registered: ‎12-28-2009
Message 5 of 5 (168 Views)

Re: Odd Problem with Finding a Block

10-09-2012 08:20 AM 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 2013 User using Visual LISP for editing LISP and DCL files
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.