Jump to content

How To Insert Block Using Lisp????


Guest balajibth84

Recommended Posts

Guest balajibth84

Hai Here Balaji...I want insert the Block using lisp...Ex:In my Block i have created the Blockname is 1,2,3...

 

Now i want insert the block 1 means just single command like 1 means its need to place to with that as it is angle....For u r reference here i have attached the Dwg also.....Can u help????for this..I am using Cad 2007......For_Test.dwg

Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • mdbdesign

    8

  • BlackBox

    6

  • alanjt

    4

Guest balajibth84

I have multiple combination(More Different Blocks) of blocks......For this insert block we r spending the time.....Just i want place manually...Suppose i want place some combination of blocks....

 

*****After insert command Just i will give that Block name means its should be place where i am picking...And angle as per block angle its maintain means also its well enough...I am using Cad 2007 Version.....***** ...

 

Thanks in advance...........

Link to comment
Share on other sites

It was an answer to possibly why no one has responded to your thread.

 

To answer your question, choose one of the three following options:

(command "_.-insert"...)

(vla-insertblock ...

(entmakex (list '(0 . "INSERT") ...

Link to comment
Share on other sites

Guest balajibth84
It was an answer to possibly why no one has responded to your thread.

 

To answer your question, choose one of the three following options:

(command "_.-insert"...)

(vla-insertblock ...

(entmakex (list '(0 . "INSERT") ...

 

 

Hai plz tell clearly..Step by Step.....Lisp is not possible????Now we r using more blocksSuppose we r using any option means its takng more time....So only i am asking the Lisp code...

Link to comment
Share on other sites

Guest balajibth84
It was an answer to possibly why no one has responded to your thread.

 

To answer your question, choose one of the three following options:

(command "_.-insert"...)

(vla-insertblock ...

(entmakex (list '(0 . "INSERT") ...

 

 

Hai As per this I have prepared shortcut....Actually we are using morethan 200 blocks...Plz see below mentioned Lisp...

 

(defun c:100100()

(command "_.-insert" "MC100-MC100" "R" "0" ))

 

(defun c:100125()

(command "_.-insert" "MC100-MC125" "R" "0" ))

 

(defun c:100150()

(command "_.-insert" "MC100-MC150" "R" "0" ))

 

(defun c:125125()

(command "_.-insert" "MC125-MC125" "R" "0" ))

 

(defun c:125100()

(command "_.-insert" "MC125-MC100" "R" "0" ))

 

(defun c:125150()

(command "_.-insert" "MC125-MC150" "R" "0" ))

 

(defun c:150150()

(command "_.-insert" "MC150-MC150" "R" "0" ))

 

(defun c:150100()

(command "_.-insert" "MC150-MC100" "R" "0" ))

 

(defun c:150125()

(command "_.-insert" "MC150-MC125" "R" "0" ))

 

(defun c:MC150-MC200()

(command "_.-insert" "MC150-MC200" "R" "0" ))

 

(defun c:200200()

(command "_.-insert" "MC200-MC200" "R" "0" ))

 

(defun c:200150()

(command "_.-insert" "MC200-MC150" "R" "0" ))

 

(defun c:2032520325()

(command "_.-insert" "UB203X133X25-UB203X133X25" "R" "0" ))

 

Actually i am Insert the Blocks using that blocks name....Now we have 200 hundred blocks..So for that 200 block i cannt create this...So i am taken that block naqme..So hw to update for all blocks???to this lisp???Any idea????oterwise i want prepare 200 times same???(See i have mentioned Block name and Shortcut command)

Link to comment
Share on other sites

Hi Balaji,

 

Please understand... I believe this is not your intention, but some people receive your posts to be impatient, demanding, and even rude. We want to help you, but only if you are patient, understanding, and kind.

 

Thank you for considerring my request.

 

:: BACK ON TOPIC ::

 

As another option, have you considered creating a Tool Palette for your 200 blocks instead of writing LISP for each?

 

A Tool Palette is easy to create, maintain, and share between users.

 

Hope this helps!

Link to comment
Share on other sites

Hi Balaji,

 

Please understand... I believe this is not your intention, but some people receive your posts to be impatient, demanding, and even rude. We want to help you, but only if you are patient, understanding, and kind.

 

Thank you for considerring my request.

 

:: BACK ON TOPIC ::

 

As another option, have you considered creating a Tool Palette for your 200 blocks instead of writing LISP for each?

 

A Tool Palette is easy to create, maintain, and share between users.

 

Hope this helps!

You beat me to it, but I completely agree.

Link to comment
Share on other sites

Guest balajibth84
Hi Balaji,

 

Please understand... I believe this is not your intention, but some people receive your posts to be impatient, demanding, and even rude. We want to help you, but only if you are patient, understanding, and kind.

 

Thank you for considerring my request.

 

:: BACK ON TOPIC ::

 

As another option, have you considered creating a Tool Palette for your 200 blocks instead of writing LISP for each?

 

A Tool Palette is easy to create, maintain, and share between users.

 

Hope this helps!

 

ohhh.i understood.Tool palette means how to create???How to Include all blocks to that tool pallete???Plz tell step by step..Iam waiting for u r hope ful reply....????

Link to comment
Share on other sites

I appreciate your liking my suggestion, but did you understand my request in the first part, my friend?

 

ohhh.i understood.Tool palette means how to create???How to Include all blocks to that tool pallete???Plz tell step by step..Iam waiting for u r hope ful reply....????

 

 

Here is a link to a tutorial that might help you:

AutoCAD 2004 Customization Tutorial: Creating a New Tool Palette

 

The tutorial uses AutoCAD 2004, but it will still work for you using 2007. Not sure about Mechanical?

Link to comment
Share on other sites

It was an answer to possibly why no one has responded to your thread.

 

To answer your question, choose one of the three following options:

(command "_.-insert"...)

(vla-insertblock ...

(entmakex (list '(0 . "INSERT") ...

 

Alan you forgot to number options ie:

1

2

3

:o

Link to comment
Share on other sites

Alan you forgot to number options ie:

1

2

3

:o

 

What happened... did you get to the second option listed and look back at the first for a reference point, and get lost among the lot?

 

'Number your options'... that's the funniest thing I've read today :lol:. Thank you!

 

Edit: And he gives an example!! lmao

Link to comment
Share on other sites

Alan you forgot to number options ie:

1

2

3

:o

I don't even know how to respond to that.

 

I think is less time consuming just to pick number instead of retyping line of code...LOL

Can it be done with lisp? (number picking):D

Huh?

Link to comment
Share on other sites

Guest balajibth84
It was an answer to possibly why no one has responded to your thread.

 

To answer your question, choose one of the three following options:

(command "_.-insert"...)

(vla-insertblock ...

(entmakex (list '(0 . "INSERT") ...

 

 

Hai Barry Here Balaji.

I have Shortcut for Blocks insert.We are using more blocks.Now i want insert the blocks using Shortcuts Lisp means Its asking

 

X scale factor

Y scale factor

And Rotaion Angle.

 

So in my Lisp I want to add:

 

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

So in below mentioned Shorts Cuts How to include this Scale Factor and Rotation Angle Values?Please Help me.

 

(defun c:T506()

(command "_Insert" "T506" ))

 

(defun c:T656()

(command "_Insert" "T656" ))

 

(defun c:T756()

(command "_Insert" "T756" ))

 

 

And One more thing..

We are Using So many blocks More than 350..Now i want create that black short means each and every time i want paste this code..

 

(defun c:XXXX()

(command "_Insert" "XXXX" ))

 

If its possible i want update latest updation to that single place.Like that lisp having some adding the next block list means easily i will add that..Like

T506 Blocname--->ShortCut Command is T506

T500 Blocname--->ShortCut Command is T500

T600 Blocname--->ShortCut Command is T600

 

What ever in Block name directly i want use that name in command line means its need to insert...With Astual Size.So i want

 

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

Edited by balajibth84
For Multi BlockInsert in Single Lsp
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...