如何获取动态块原始块名?
请教各位,cad08以后出现了动态块,如果对块进行调整后块名就变成匿名块名,有没有办法获取动态块的原始块名,在属性栏中是可以看见原始块名的,但是组码已经变化了谢谢
(vla-get-EffectiveName(vlax-ename->vla-object (car(entsel))));;;获取动态块原始块名 vla-get-EffectiveName 本帖最后由 firstinti 于 2011-5-15 19:26 编辑
非常感谢
找到一篇有关动态块选择集的文章,和菜兄一起分享,不过估计菜兄的选择易早已解决了这个问题
Hi,
I do this to run trough a selectionset obtaing effective blocknames.
(setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
One of the blocknames is "E_ARM0203-50*U49"
But when I do this;
(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
The result is nil.
I assume this is because there's no unchanged block in the drawings
database.
Is there another way to ssget this dynamic block?
Kind regards,
MCorrect. To get dynamic blocks, search for all block references. Then loop
through the active selection set looking for the blocks you want by using
the effectivename property.Something like (not tested)
{code}
(if (ssget '(0 . "insert"))
(vlax-for n
(vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
(if (wcmatch (vla-get-effectivename n) pattern)
(progn....))))
{code}
"M. Janmaat"wrote in message
news:6375341@discussion.autodesk.com...
Hi,
I do this to run trough a selectionset obtaing effective blocknames.
(setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
One of the blocknames is "E_ARM0203-50*U49"
But when I do this;
(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
The result is nil.
I assume this is because there's no unchanged block in the drawings
database.
Is there another way to ssget this dynamic block?
Kind regards,
MHi,
Just a reminder, if you use (wcmatch ...) and have asterisks in your block
names, don't forget that in order to read a character literally, you might
need to escape them using the reverse quote in the pattern (eventually see
the help).
` (reverse quote) Escapes special characters (reads next character
literally)
Regards
"M. Janmaat"a écrit dans le message de news:
6375341@discussion.autodesk.com...
Hi,
I do this to run trough a selectionset obtaing effective blocknames.
(setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
One of the blocknames is "E_ARM0203-50*U49"
But when I do this;
(setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
The result is nil.
I assume this is because there's no unchanged block in the drawings
database.
Is there another way to ssget this dynamic block?
Kind regards,
MThanks!
"Doug Broad"schreef in bericht
news:6375519@discussion.autodesk.com...
> Correct. To get dynamic blocks, search for all block references. Then loop
> through the active selection set looking for the blocks you want by using
> the effectivename property.Something like (not tested)
> {code}
> (if (ssget '(0 . "insert"))
>(vlax-for n
> (vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
> (if (wcmatch (vla-get-effectivename n) pattern)
> (progn....))))
> {code}
>
>
> "M. Janmaat"wrote in message
> news:6375341@discussion.autodesk.com...
> Hi,
>
> I do this to run trough a selectionset obtaing effective blocknames.
>
> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>
> One of the blocknames is "E_ARM0203-50*U49"
>
> But when I do this;
>
> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>
> The result is nil.
>
> I assume this is because there's no unchanged block in the drawings
> database.
>
> Is there another way to ssget this dynamic block?
>
> Kind regards,
>
> MThanks!
"Some Buddy"schreef in bericht
news:6375528@discussion.autodesk.com...
> Hi,
>
> Just a reminder, if you use (wcmatch ...) and have asterisks in your block
> names, don't forget that in order to read a character literally, you might
> need to escape them using the reverse quote in the pattern (eventually see
> the help).
>
> ` (reverse quote) Escapes special characters (reads next character
> literally)
>
>
> Regards
>
>
>
> "M. Janmaat"a écrit dans le message de news:
> 6375341@discussion.autodesk.com...
> Hi,
>
> I do this to run trough a selectionset obtaing effective blocknames.
>
> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>
> One of the blocknames is "E_ARM0203-50*U49"
>
> But when I do this;
>
> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>
> The result is nil.
>
> I assume this is because there's no unchanged block in the drawings
> database.
>
> Is there another way to ssget this dynamic block?
>
> Kind regards,
>
> MDoug,
I want to do something like (ssadd (vla-get-entityname n) ss1) at where you
have(progn....)
Do you know the code to create the selectionset when the blocks are found.
If I ask for help on "vla-get-effectivename" for example, I get redirected
to http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=9339357
It seems like AutoDesk has given up on the local Help files and redirects to
the Internet now.
Apparently there is no help for"vla-get-effectivename".
Are there any other locations for explanation on vla-commands that you know
of?
Kind regards,
M
"Doug Broad"schreef in bericht
news:6375519@discussion.autodesk.com...
> Correct. To get dynamic blocks, search for all block references. Then loop
> through the active selection set looking for the blocks you want by using
> the effectivename property.Something like (not tested)
> {code}
> (if (ssget '(0 . "insert"))
>(vlax-for n
> (vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
> (if (wcmatch (vla-get-effectivename n) pattern)
> (progn....))))
> {code}
>
>
> "M. Janmaat"wrote in message
> news:6375341@discussion.autodesk.com...
> Hi,
>
> I do this to run trough a selectionset obtaing effective blocknames.
>
> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>
> One of the blocknames is "E_ARM0203-50*U49"
>
> But when I do this;
>
> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>
> The result is nil.
>
> I assume this is because there's no unchanged block in the drawings
> database.
>
> Is there another way to ssget this dynamic block?
>
> Kind regards,
>
> MThere is no get-entityname.
Use vlax-vla-object->ename to convert object to enames.
This is usually an unnecessary step, since objects support most of the
manipulation features of entities.
"M. Janmaat"wrote in message
news:6376181@discussion.autodesk.com...
Doug,
I want to do something like (ssadd (vla-get-entityname n) ss1) at where you
have(progn....)
Do you know the code to create the selectionset when the blocks are found.
If I ask for help on "vla-get-effectivename" for example, I get redirected
to http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=9339357
It seems like AutoDesk has given up on the local Help files and redirects to
the Internet now.
Apparently there is no help for"vla-get-effectivename".
Are there any other locations for explanation on vla-commands that you know
of?
Kind regards,
M
"Doug Broad"schreef in bericht
news:6375519@discussion.autodesk.com...
> Correct. To get dynamic blocks, search for all block references. Then loop
> through the active selection set looking for the blocks you want by using
> the effectivename property.Something like (not tested)
> {code}
> (if (ssget '(0 . "insert"))
>(vlax-for n
> (vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
> (if (wcmatch (vla-get-effectivename n) pattern)
> (progn....))))
> {code}
>
>
> "M. Janmaat"wrote in message
> news:6375341@discussion.autodesk.com...
> Hi,
>
> I do this to run trough a selectionset obtaing effective blocknames.
>
> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>
> One of the blocknames is "E_ARM0203-50*U49"
>
> But when I do this;
>
> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>
> The result is nil.
>
> I assume this is because there's no unchanged block in the drawings
> database.
>
> Is there another way to ssget this dynamic block?
>
> Kind regards,
>
> MYes.They absolutely destroyed the developer help in 2011.The user help
was virtually destroyed as well.I will maintain my previous version of
AutoCAD as long as possible due to these serious issues.
"M. Janmaat"wrote in message
news:6376181@discussion.autodesk.com...
Doug,
I want to do something like (ssadd (vla-get-entityname n) ss1) at where you
have(progn....)
Do you know the code to create the selectionset when the blocks are found.
If I ask for help on "vla-get-effectivename" for example, I get redirected
to http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=9339357
It seems like AutoDesk has given up on the local Help files and redirects to
the Internet now.
Apparently there is no help for"vla-get-effectivename".
Are there any other locations for explanation on vla-commands that you know
of?
Kind regards,
M
"Doug Broad"schreef in bericht
news:6375519@discussion.autodesk.com...
> Correct. To get dynamic blocks, search for all block references. Then loop
> through the active selection set looking for the blocks you want by using
> the effectivename property.Something like (not tested)
> {code}
> (if (ssget '(0 . "insert"))
>(vlax-for n
> (vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
> (if (wcmatch (vla-get-effectivename n) pattern)
> (progn....))))
> {code}
>
>
> "M. Janmaat"wrote in message
> news:6375341@discussion.autodesk.com...
> Hi,
>
> I do this to run trough a selectionset obtaing effective blocknames.
>
> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>
> One of the blocknames is "E_ARM0203-50*U49"
>
> But when I do this;
>
> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>
> The result is nil.
>
> I assume this is because there's no unchanged block in the drawings
> database.
>
> Is there another way to ssget this dynamic block?
>
> Kind regards,
>
> MThanks Doug,
For both comments.
It's annoying. I don't see any benifits.
Cheers,
M
"Doug Broad"schreef in bericht
news:6376585@discussion.autodesk.com...
> Yes.They absolutely destroyed the developer help in 2011.The user help
> was virtually destroyed as well.I will maintain my previous version of
> AutoCAD as long as possible due to these serious issues.
>
>
> "M. Janmaat"wrote in message
> news:6376181@discussion.autodesk.com...
> Doug,
>
> I want to do something like (ssadd (vla-get-entityname n) ss1) at where
> you
> have(progn....)
>
> Do you know the code to create the selectionset when the blocks are found.
>
> If I ask for help on "vla-get-effectivename" for example, I get redirected
> to http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=9339357
>
> It seems like AutoDesk has given up on the local Help files and redirects
> to
> the Internet now.
>
> Apparently there is no help for"vla-get-effectivename".
>
> Are there any other locations for explanation on vla-commands that you
> know
> of?
>
> Kind regards,
>
> M
>
> "Doug Broad"schreef in bericht
> news:6375519@discussion.autodesk.com...
>> Correct. To get dynamic blocks, search for all block references. Then
>> loop
>> through the active selection set looking for the blocks you want by using
>> the effectivename property.Something like (not tested)
>> {code}
>> (if (ssget '(0 . "insert"))
>>(vlax-for n
>> (vla-get-activeselectionset(vla-get-activedocument(vlax-get-acad-object)))
>> (if (wcmatch (vla-get-effectivename n) pattern)
>> (progn....))))
>> {code}
>>
>>
>> "M. Janmaat"wrote in message
>> news:6375341@discussion.autodesk.com...
>> Hi,
>>
>> I do this to run trough a selectionset obtaing effective blocknames.
>>
>> (setq sbn (vla-get-effectivename (vlax-ename->vla-object (cdar el1))))
>>
>> One of the blocknames is "E_ARM0203-50*U49"
>>
>> But when I do this;
>>
>> (setq ss1 (ssget "x" (list (cons 0 "INSERT") (cons 2 "E_ARM0203*")))))
>>
>> The result is nil.
>>
>> I assume this is because there's no unchanged block in the drawings
>> database.
>>
>> Is there another way to ssget this dynamic block?
>>
>> Kind regards,
>>
>> MThe developer help is still local.Evidently there is a way
to redirect the on-line help to local help files but you still
get a browser window regardless.I've not made those
adjustments so I'm not familiar with the procedure.
acadauto.chm is the local developer help file.
"M. Janmaat"wrote in message news:6376181@discussion.autodesk.com...
> Are there any other locations for explanation on vla-commands that you know of?
From:CAD吧 (http://www.cad8.net/)
Link:http://www.cad8.net/xthread-148700-1-1.html
选择易里面的动态块原始块名过滤功能已经增加了,但暂不支持通配符,有兴趣请测试。跟上面这篇论坛贴子讲的差不多。
顺便说一下,选择易不能说是我的,这点在发贴的时候已经作了说明,但我希望大家能一起来完善。 解决了一大问题,3Q 而且不能进入参照编辑保存
页:
[1]