Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Use userinput as block name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I'm overlooking something really simple. I wonder if someone can help me. I just need the userinput to be incorporated in the insert command but don't know how to segregate the block name from the block path..
;;;PROMPT USER FOR BLOCK NAME HERE
(setq userinBLKNAME (getstring "\nPlease type in the block name shown in the allrevblocks - ex: IFCC4:"))
;;;INSERT BLOCK BASED ON BLOCK NAME PROVIDED HERE
(command "-insert" "B:\\CAD\\REVBLOCKS\\IFC\\"USERINBLKNAME PAUSE "1" "" "")
Re: Use userinput as block name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I would personally string the block name and directory path together and stay away from the pause. HTH.
Re: Use userinput as block name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
kameron1967 wrote:.... I just need the userinput to be incorporated in the insert command but don't know how to segregate the block name from the block path..
;;;PROMPT USER FOR BLOCK NAME HERE
(setq userinBLKNAME (getstring "\nPlease type in the block name shown in the allrevblocks - ex: IFCC4:"));;;INSERT BLOCK BASED ON BLOCK NAME PROVIDED HERE
(command "-insert" "B:\\CAD\\REVBLOCKS\\IFC\\"USERINBLKNAME PAUSE "1" "" "")
(command
"-insert"
(strcat "B:\\CAD\\REVBLOCKS\\IFC\\" USERINBLKNAME)
PAUSE "1" "" ""
)
But unless you might have different drawings with the same name in different filepath locations, you could just put that filepath in the Support File Search Path list, forget the variable, and just do:
(command "-insert" (getstring "\Block name from allrevblocks - ex: IFCC4: ") pause 1 "" "")
Re: Use userinput as block name
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks, Kent1Cooper! I appreciate the quick help! ![]()

