Jump to content

How To Insert Block Using Lisp????


Guest balajibth84

Recommended Posts

Guest balajibth84
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.

 

I am waiting for your hopeful reply

Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • mdbdesign

    8

  • BlackBox

    6

  • alanjt

    4

Try to analyze "-insert" command and add missing sequences to lisp code (command "_Insert" "XXXX" ))

How many "cad" people work in your company?

Link to comment
Share on other sites

Guest balajibth84
Try to analyze "-insert" command and add missing sequences to lisp code (command "_Insert" "XXXX" ))

How many "cad" people work in your company?

 

Hai MdbDesign i have tried .But its not working.See the below mentioned Code.And I want to Give that X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

(defun c:T506()

(command "_Insert" "XXXX" ))

 

And i want update in same lisp with block name means its need to read.So how to Create code for that.Like in Lisp Code having the List of block means Upcoming Block i will easily Add to that list as per the Block name.What ever block name i mentioned i want to use that name directly to cad command line pallate and i want to insert.So here i want to give and fix the below value.

 

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

In my company 45 Are Peoples are working.Why mdbdesign?

Edited by balajibth84
Missed to Update
Link to comment
Share on other sites

Guest balajibth84

Till now i cannt able to fix that

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0. So plz Fix this Value.For All Blocks...

 

While adding the Block till now i am paste that code and editing like below mentioned

 

(defun c:T506()

(command "-Insert" "T506" "XXXX" ))

 

(defun c:T656()

(command "-Insert" "T656" "XXXX" ))

 

(defun c:T756()

(command "-Insert" "T756" "XXXX" ))

Link to comment
Share on other sites

Everything is working:

GO step by step and add missing part of code to main code.

Example:

Command: -insert

Enter block name or [?] : ;HIT ENTER

 

Units: Inches Conversion: 1.00000000

Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: ;PICK INSERT POINT, NEED TO INTERRUPT CODE TO ADD USER INPUT

Enter X scale factor, specify opposite corner, or [Corner/XYZ] : ;HIT ENTER TO CONFORM SCALE X

Enter Y scale factor : ;HIT ENTER TO CONFORM SCALE Y

 

Specify rotation angle : ;HIT ENTER TO CONFORM ROTATION DEFAULT 0 DEG

 

now try to update your code.

 

In my company 45 Are Peoples are working.Why mdbdesign?
How many of them is lisp capable?
Link to comment
Share on other sites

Guest balajibth84
Everything is working:

GO step by step and add missing part of code to main code.

Example:

Command: -insert

Enter block name or [?] : ;HIT ENTER

 

Units: Inches Conversion: 1.00000000

Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: ;PICK INSERT POINT, NEED TO INTERRUPT CODE TO ADD USER INPUT

Enter X scale factor, specify opposite corner, or [Corner/XYZ] : ;HIT ENTER TO CONFORM SCALE X

Enter Y scale factor : ;HIT ENTER TO CONFORM SCALE Y

 

Specify rotation angle : ;HIT ENTER TO CONFORM ROTATION DEFAULT 0 DEG

 

now try to update your code.

 

How many of them is lisp capable?

 

 

 

Ya its working Good.With Out Insert Command We can INsert?Like i want insert T506 means Directly i want Give the Command is T506.Is it Possible???

Link to comment
Share on other sites

Guest balajibth84

Till now its asking the

 

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

as per #25 Thread..Each and every time i want to give Enter??Just i want to mention T506 and I am selecting pick point means its need to Place.So i want to Fix the Default Value is

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

And directly i want access with the Block name.Just in open command line pallete i am given T506 means its need to ask picjk point aftr i am selecting the pick point means its automatically need to place with that above mentioned X,Y Scale Factor and Rotation Angle(0)...So is it possible??Bcoz we r working with So many block.

Link to comment
Share on other sites

So i want to Fix the Default Value is

X scale factor is 1

Y scale factor is 1 and

Rotation Angle is 0.

 

And directly i want access with the Block name.Just in open command line palette i am given T506 means its need to ask picjk point aftr i am selecting the pick point means its automatically need to place with that above mentioned X,Y Scale Factor and Rotation Angle(0)...So is it possible??Bcoz we r working with So many block.

 

Balaji, you have two options:

 

1) If you're using a tool palette (as suggested), simply right click the block in the palette (T506 for example), and select Properties. From the you can specify the block scale, and rotation, among many other options.

 

2) If you insist on writing LISP code for your hundreds of blocks, then perhaps explicitly declaring the value is prudent, example:

 

(command "._-insert" "T506" pause 1 1 0)

Link to comment
Share on other sites

Guest balajibth84

Actuall as per this Continue Thread i got some good Level Lisp..Please see this top thread #25.So i want update that Code as per my #27 th thread....

Link to comment
Share on other sites

Guest balajibth84

Hai i have tried below code.

 

(defun c:T506()

(command "._-insert" "T506" pause 1 1 0)

 

But error is coming..."Command: ; error: malformed list on input"

Link to comment
Share on other sites

Hai i have tried below code.

 

(defun c:T506()

(command "._-insert" "T506" pause 1 1 0)

 

But error is coming..."Command: ; error: malformed list on input"

 

Instead, try this:

 

(defun c:T506 ()
 (command "._-insert" "T506" pause 1 1 0)
 (princ)[b][color=red])[/color][/b]

 

 

Note - This code assumes that your block resides within one of the included support paths. If not, this too will error out.

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...