entmod issue...
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
entmod issue...

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
cyberstrategist
Guest





Posted: Tue Apr 05, 2005 6:43 pm    Post subject: entmod issue... Reply with quote

OK, so I went through the different entmod posts here and really didn't find anything specific for my case so here I go...

I have the following line of code that is modifying a block to replace it with another block. It works most all the time but I can not figure out why I have cases where it does not work.

(entmod (subst (cons 2 new_sym) (assoc 2 (entget ent_name)) (entget ent_name))
(entupd ent_name)


I am using MAP 6 and all my entity mods are done via LISP...


Any ideas??

Back to top
avw_410
Guest





Posted: Tue Apr 05, 2005 7:38 pm    Post subject: Re: entmod issue... Reply with quote

I have a routine that will do exactly this... if you want it i will send it...
"cyberstrategist" <x2twlutx@southernco.com> wrote in message news:4252a3f6$1_3@newsprd01...
OK, so I went through the different entmod posts here and really didn't find anything specific for my case so here I go...

I have the following line of code that is modifying a block to replace it with another block. It works most all the time but I can not figure out why I have cases where it does not work.

(entmod (subst (cons 2 new_sym) (assoc 2 (entget ent_name)) (entget ent_name))
(entupd ent_name)


I am using MAP 6 and all my entity mods are done via LISP...


Any ideas??
Back to top
Joe Burke
Guest





Posted: Tue Apr 05, 2005 7:45 pm    Post subject: Re: entmod issue... Reply with quote

Have you tried the Express Tools "blockreplace" command?

Joe Burke

Back to top
cyberstrategist
Guest





Posted: Tue Apr 05, 2005 9:26 pm    Post subject: Re: entmod issue... Reply with quote

The lines of code work fine most all the time, maybe 98% of the time considering the volume of usage our users utilize the routine it's included in. If you can, please send the routine and I'll have a look at it.
"avw_410" <avw_410@yahoo.com> wrote in message news:4252b164_1@newsprd01...
I have a routine that will do exactly this... if you want it i will send it...
"cyberstrategist" <x2twlutx@southernco.com> wrote in message news:4252a3f6$1_3@newsprd01...
OK, so I went through the different entmod posts here and really didn't find anything specific for my case so here I go...

I have the following line of code that is modifying a block to replace it with another block. It works most all the time but I can not figure out why I have cases where it does not work.

(entmod (subst (cons 2 new_sym) (assoc 2 (entget ent_name)) (entget ent_name))
(entupd ent_name)


I am using MAP 6 and all my entity mods are done via LISP...


Any ideas??
Back to top
mataeux
Guest





Posted: Wed Apr 06, 2005 4:12 am    Post subject: Re: entmod issue... Reply with quote

would you be willing to share a block for which that code does not work? i've never seen it not work

thanks
"cyberstrategist" <x2twlutx@southernco.com> wrote in message news:4252a3f6$1_3@newsprd01...
OK, so I went through the different entmod posts here and really didn't find anything specific for my case so here I go...

I have the following line of code that is modifying a block to replace it with another block. It works most all the time but I can not figure out why I have cases where it does not work.

(entmod (subst (cons 2 new_sym) (assoc 2 (entget ent_name)) (entget ent_name))
(entupd ent_name)


I am using MAP 6 and all my entity mods are done via LISP...


Any ideas??
Back to top
cyberstrategist
Guest





Posted: Wed Apr 06, 2005 5:24 pm    Post subject: Re: entmod issue... Reply with quote

You have the statement below, the entmod statement. It works but it still leaves the old block there. But this only happens occasionally and I'm trying to figure out why. I basically have 2 blocks in the end, one on top of the other...
"mataeux" <mataeux@yahoo.com> wrote in message news:4253295a$1_2@newsprd01...
would you be willing to share a block for which that code does not work? i've never seen it not work

thanks
"cyberstrategist" <x2twlutx@southernco.com> wrote in message news:4252a3f6$1_3@newsprd01...
OK, so I went through the different entmod posts here and really didn't find anything specific for my case so here I go...

I have the following line of code that is modifying a block to replace it with another block. It works most all the time but I can not figure out why I have cases where it does not work.

(entmod (subst (cons 2 new_sym) (assoc 2 (entget ent_name)) (entget ent_name))
(entupd ent_name)


I am using MAP 6 and all my entity mods are done via LISP...


Any ideas??
Back to top
Tom Smith
Guest





Posted: Wed Apr 06, 2005 5:56 pm    Post subject: Re: entmod issue... Reply with quote

You were missing a parenthesis in there. The routine will fail if the new block isn't already defined in the drawing, but it will fail simply by not doing anything.

I use similar routines to replace blocks, and have never seen them leave an extra instance of the block. I don't see how that's possible in your entmod, though I'm a little suspicious of the double entget. I'd get the entity data in a variable and then hand that variable to the entmod, rather than getting the data twice during the entmod.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB