Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems whit inserting block whit insert command

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Thomas.l
403 Views, 5 Replies

Problems whit inserting block whit insert command

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

5 REPLIES 5
Message 2 of 6
ranjith0326
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
Message 3 of 6
Thomas.l
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"
    ""
    )

 

 

Message 4 of 6
ranjith0326
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
Message 5 of 6
Thomas.l
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

Message 6 of 6
ranjith0326
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost