Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Distinguished Contributor
Thomas.l
Posts: 109
Registered: ‎04-16-2011
Message 1 of 6 (206 Views)
Accepted Solution

Problems whit inserting block whit insert command

206 Views, 5 Replies
03-27-2012 01:59 PM

Hi

 

I am working on a lisp file that lets you select a block and automaticaly change the layer and color in block editor. Afther this it exits block editor, deletes the original block and places the new one.

 

It works fine accept for the last part.

When i incert my new name whit the insert command it automaticaly changes the name whit autofil so it wil still pot my originial block (the new block name is only two characters shorter than the old one).

 

Is there eny way to work around this problem?

 

Thanks in advance!

 

Thomas

 

P.S.: my apology's for the fact that my block is written in dutch

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 2 of 6 (193 Views)

Re: Problems whit inserting block whit insert command

03-27-2012 09:47 PM in reply to: Thomas.l

 

Hi Thomas,

 

'Y' scale must be more than Zero, Please find the update in Below line.

 

(command "insert" bln (cdr (assoc 10 (entget obl))) "1" "1" "")

Regards,

R.Ranjith
Distinguished Contributor
Thomas.l
Posts: 109
Registered: ‎04-16-2011
Message 3 of 6 (183 Views)

Re: Problems whit inserting block whit insert command

03-28-2012 12:34 AM in reply to: ranjith0326

Hi Ranjith

 

Thank you for this responce it solved my problem.

 

But how do you know which parameters you have to add? (like "1")

I do it simply by trial and error.

 

Regards

 

Thomas

 

P.S.: i had to make a litle adjustment, because i deleted the block befor i used it i had to get the insertion point sooner:

 

 

(setq ip (cdr (assoc 10 (entget obl))))
  ;bepalen invoeg punt voor block, dit moet hier gebeuren omdat de block zelf straks verwijderd is en er dan geen waardes meer van opgevraagd kunnen worden

  (command
    "erase"
    obl ;original block
    ""
    )
  ;verwijder originele blcok

  (command
    "insert"
    bln
    ip
    "1"
    "1"
    ""
    )

 

 

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 4 of 6 (179 Views)

Re: Problems whit inserting block whit insert command

03-28-2012 12:45 AM in reply to: Thomas.l

Hi Thomas,

 

That parameter is scale value of 'Y' Direction.... (you can change if you want to scaling your block).

 

Enter manualy "-insert" in command line, you can see the step by step Input...

 

(command
    "insert";Command
    bln;Block Name
    ip;Insert Point
    "1";Scale Value in X-Direction
    "1"        ;Scale Value in Y-Direction
    ""          ;Rotation Angle ("" for 0 degree")
    )

 

Regards,

R.Ranjith
Distinguished Contributor
Thomas.l
Posts: 109
Registered: ‎04-16-2011
Message 5 of 6 (176 Views)

Re: Problems whit inserting block whit insert command

03-28-2012 12:51 AM in reply to: ranjith0326

Hi Ranjith

 

one more litle question:

Can this be done for every command?

 

Because i just tested it for saves and it doesn't work.

 

Regards

 

Thomas

Contributor
ranjith0326
Posts: 24
Registered: ‎04-16-2011
Message 6 of 6 (171 Views)

Re: Problems whit inserting block whit insert command

03-28-2012 01:57 AM in reply to: Thomas.l

Hi Thomas,

 

If you want to see the step by step procedure for Saveas command,

 

change filedia variable as "0", then try command saveas.....

 

 

Also refer below link for more clear..

 

http://www.afralisp.net/archive/methods/lista/saveas_method.htm

 

 

Regards,

R.Ranjith

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community