CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedHow to remove prompt and specify block name

 Post Reply Post Reply
Author
kameron1967 View Drop Down
Groupie
Groupie


Joined: 30.Jan.2011
Location: United States
Using: autocad 2018
Status: Offline
Points: 29
Direct Link To This Post Topic: How to remove prompt and specify block name
    Posted: 14.Mar.2011 at 15:55
I'm looking to replace the selection option to it automatically selecting "BlockA".  How would you change this, please.
Code:

(setq ss (nth 3
  (vlax-invoke
    (vlax-ename->vla-object (car (entsel "\nSelect Block: ")))
    'GetAttributes)))
Back to Top
CarlB View Drop Down
Senior Member
Senior Member


Joined: 16.Oct.2009
Location: United States
Status: Offline
Points: 321
Direct Link To This Post Posted: 14.Mar.2011 at 20:55
One way:
 
Instead of
(car (entsel "\nSelect Block: "))

use
 
(ssname (ssget "_X" '((0 . "INSERT")(2 . "BlockA"))) 0)
Back to Top
kameron1967 View Drop Down
Groupie
Groupie


Joined: 30.Jan.2011
Location: United States
Using: autocad 2018
Status: Offline
Points: 29
Direct Link To This Post Posted: 14.Mar.2011 at 21:49
Carl - does it replace the code above?  If not, I wonder how I would put that information in there so that it reads the block name, instead of asking for it.  Thanks!
Back to Top
CarlB View Drop Down
Senior Member
Senior Member


Joined: 16.Oct.2009
Location: United States
Status: Offline
Points: 321
Direct Link To This Post Posted: 14.Mar.2011 at 23:10
This is the complete code after substitution:
 
(setq ss (nth 3
  (vlax-invoke
    (vlax-ename->vla-object
       (ssname (ssget "_X" '((0 . "INSERT")(2 . "BlockA"))) 0))
    'GetAttributes)))
Back to Top
kameron1967 View Drop Down
Groupie
Groupie


Joined: 30.Jan.2011
Location: United States
Using: autocad 2018
Status: Offline
Points: 29
Direct Link To This Post Posted: 14.Mar.2011 at 23:26
Excellent.  Thanks, CarlB! Smile
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,172 seconds.