Blatant ask for Lisp help :-)

Blatant ask for Lisp help :-)

Anonymous
Not applicable
823 Views
4 Replies
Message 1 of 5

Blatant ask for Lisp help :-)

Anonymous
Not applicable

Hi,

 

Ok, I am on the scrounge if I can please.

 

Can someone put together a couple of Lisps for me? I am using Acad2014 if that makes a difference.

 

The first:

- upon pressing any single keystroke

- activate command 'ROTATE3D'

- user selects item on screen

- sub command option value 'x-axis'

- value '-90'

- return back to where we were

 

The second:

- user command key 'k'

- activates command '3DORBITCTR'

- the command is expecting user input 'specify orbit center point'

- Lisp to automatically selects the snap point 'node'

- user selects the desired node on screen and holding it down is able to rotate the block in 3D

- upon releasing, return back to where we were

 

Hopefully someone can help.....?

 

Thanks guys.

 

R

 

0 Likes
Accepted solutions (2)
824 Views
4 Replies
Replies (4)
Message 2 of 5

Sea-Haven
Mentor
Mentor
Accepted solution

This is question 1

 

(defun c:3 ( / ent pt )
(setq ent (entsel "\Pick object to rotate3d"))
(setq pt (Getpoint "\nPick point of rotation"))
(command "rotate3d" ent "" "X" pt 90)
)

Question 2 I would not use "k" as autocad may use in future

 

(defun c:2 ( / )
(command "3DORBITCTR" "_node" (getpoint) pause)
)
Message 3 of 5

Anonymous
Not applicable

Hi Sea.haven,

 

Big, big thank you for those.

 

One query, the first

(setq pt (Getpoint "\nPick point of rotation"))
(command "rotate3d" ent "" "X" pt 90)

I realised that after selecting the point, the user input should be 'x' as you have done but the next bit 'specify a point of the x axis' should always be the default of 0,0,0 rather than asking for user input. And then, the -90.

 

Do I simply delete the

(setq pt (Getpoint "\nPick point of rotation")) and instead change the next line to be:

(command "rotate3d" ent "" "X" "" -90)

 

Is this correct?

 

TIA

 

0 Likes
Message 4 of 5

Sea-Haven
Mentor
Mentor
Accepted solution

(command "rotate3d" ent "" "X" "0,0,0" 90)

 

(command "rotate3d" ent "" "X" (list 0.0 0.0 0.0) 90)

 

Safer than ""

Message 5 of 5

Anonymous
Not applicable

Thanks.

 

That's fantastic and spot on!

0 Likes