Help AutoLISP having issues with insert command.

Help AutoLISP having issues with insert command.

Jedimaster
Collaborator Collaborator
1,274 Views
5 Replies
Message 1 of 6

Help AutoLISP having issues with insert command.

Jedimaster
Collaborator
Collaborator

I am trying to migrate our company from 2015 to 2020. I have Hundreds lines of code like this (command "-INSERT" (findfile "my.dwg") pt ssf ssf 0.0) This dose not work any more the Insert command has changed. CLASSICINSERT does not seem to have an option without a dialog Tried setting FILEDIA to 0 did not help. I have been working with AutoLISP since 1988. I have seen a lot of changes but nothing this impactful.

0 Likes
Accepted solutions (1)
1,275 Views
5 Replies
Replies (5)
Message 2 of 6

chriscowgill7373
Advisor
Advisor
Accepted solution

what error message are you getting when running your code?  I too have many programs that insert blocks, but I dont have any issues running them in 2020.

I'm not using (findfile) because every block I insert is in our support file search paths, but it seems to function without issue.

(command-s ".-insert" "blockname" inspoint 1 "" "")

I've got one that is:

(command "_.insert" "armode=armode.dwg" nil)

inserts the definition without inserting the block, no errors.

 


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10

Please select the Accept as Solution button if my post solves your issue or answers your question.

0 Likes
Message 3 of 6

Jedimaster
Collaborator
Collaborator

Thanks for the reply. Your inspoint is text or list?

I use a list with reals (setq inspoint (list 9.0 0.5 0.0))

This works in 2015 but not 2020.

 

0 Likes
Message 4 of 6

chriscowgill7373
Advisor
Advisor

my inspoint varies:

selected point from the screen using the GETPOINT function

or as a string "0,0,0" (sometimes using strcat of values from a coordinate)

or as a list using '(# # #)

I cannot find any instances where I used (list # # #)

 

 


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2024 on Windows 10

Please select the Accept as Solution button if my post solves your issue or answers your question.

0 Likes
Message 5 of 6

CodeDing
Advisor
Advisor

@Jedimaster ,

 

The "-INSERT" command still works for me in 2020. As Chris said, what's the error message that pulls up when you run it? How do you KNOW that the command is the issue?

 

Best,

~DD

0 Likes
Message 6 of 6

Jedimaster
Collaborator
Collaborator

Through much more testing I have concluded that my glitch was in the scaling variable. Thanks for all the help. 

0 Likes