weedseed85 Posted August 16, 2012 Posted August 16, 2012 (edited) Dear autocad users / lisp writers, Could somebody please help me. I wrote this .lisp file (defun c: x x () ; Put Xref to right layer ; edited the line, otherwise it shows a angry smiley (command "-layer" "Make" "Xref" "color" "8" "Xref" "") (command "-Xref" "Attach" "" "0,0" "1" "1" "0" "") ) In the second (command) line, i want it to attach a xref file and i want it to ask me what file i want to put in. Otherwise i'll have to write a whole lot of lisps... Is there perhaps a way to make it display the file explorer? I hope somebody can help me with this lisp. Thanks in advance. Greets, Michel Edited August 16, 2012 by weedseed85 Quote
MSasu Posted August 16, 2012 Posted August 16, 2012 To allow the user to select a file check the GETFILED function. Also, please edit your post and add the required code tags. Thank you. Quote
weedseed85 Posted August 16, 2012 Author Posted August 16, 2012 Thank you for your reply. I've tried to edit the code part, like you asked. But i couldn't find the right way. I've marked it with red. Hopefully it's acceptable now. Thanks again. Quote
MSasu Posted August 16, 2012 Posted August 16, 2012 When edit the post, check that there is a button named Go Advanced - it will open the post in an editor with more options; there select the code part and check for a toolbar button marked #. When you post a new message this button is available in basic editor too. Alternatively may place the tags by hand: just write "[/code]" at the end of code and " " at beginning. Quote
weedseed85 Posted August 16, 2012 Author Posted August 16, 2012 I would like to thank your very much for your help. Here's the end result of my code. Perhaps it's also use to somebody else. (defun c:xx () ; Zet Xref op juiste laag (command "-layer" "Make" "Xref" "color" "8" "Xref" "") (command "-Xref" "Attach" (getfiled "Select Reference File" "K:\Tekeningenbeheer" "dwg" "0,0" "1" "1" "0" "") (command "-layer" "set" "0" "") ) Have Fun! Greets, Michel Quote
SLW210 Posted August 16, 2012 Posted August 16, 2012 Please edit your first post to include CODE TAGS!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.