Intermediate AutoLISP

  Рет қаралды 10,916

Land F/X

Land F/X

Күн бұрын

In this follow-up presentation, we’ll apply the principles covered in our AutoLISP Basics webinar to create another usable tool. This time, we’ll create a basic loop that processes all entities in the drawing, while discussing best practices in doing so. We’ll also show how to integrate your custom AutoLISP tools into the ribbon, and how best to organize your source files.

Пікірлер: 19
@r0b3rtdq
@r0b3rtdq Жыл бұрын
Thank you so much for this tutorial. There is a ton to learn from this presentation. I need to rewatch it a few times but I understood most of the explanations. Awesome job!!!
@georgekhaba6436
@georgekhaba6436 2 жыл бұрын
time table : @3:18 table of content **/concepts/** @4:55 data types @6:06 lists @7:29 list construction @10:09 more list construction @13:34 control list @17:18 selection sets @18:53 ribbon integration **/coding/** @20:40 lets do some coding @23:35 how to make a CUI interface for or program @24:41 making of CUI for the program "find closest" @27:16 *step-1- selecting the blocks* @30:51 selecting the block by the insertion point @33:06 finding the insertion point of selected block @33:55 finding the name of a selected block @35:12 processing the selection set @38:12 filtering the first item in the selection set @40:04 looping the selection set @42:32 *step-2- calculate the distance to start point* @43:15 creating the control list @44:04 putting an access panel @46:02 replacing the entity info in the list with there insertion point info @46:48 sorting the distances @47:26 standardizing the code to have additional filters @49:09 dealing with nil selection @53:35 why the vl-sort failed and how to fix it @55:44 *step-3-draw a line to the closest entity* @59:59 *step-4-adding the error flag to make sure the code run smoothly* @1:01:04 question : if we return dim default to dim line what happen ?
@azzeddineelhachimi9030
@azzeddineelhachimi9030 6 жыл бұрын
Thank you very much Mr. Jeremiah Farmer Your presentation method is so attractive and the content is so rich. I will wait impatiently for your future presentations. Thank you for sharing your knowledge in Autolisp programming.
@MrJGRalston
@MrJGRalston 4 жыл бұрын
10:11 Start of New Content prior to this review of basics video
@CyberTrokair
@CyberTrokair 4 жыл бұрын
I've been following these seminars on here and they've helped me a lot to understand lisp programming. I cannot however get my command bar to spit out the details of selected entities like it does here. Is that an autocad native systemvariable? or is there something else I'm missing?
@honkinberry
@honkinberry 4 жыл бұрын
I assume you mean at approximately 30:00 to 32:00? That is simply returning the results of AutoLISP functions. For instance, the simplest is just (entget (car (entsel))) which will return to the command line the definition of the entity you select.
@CyberTrokair
@CyberTrokair 4 жыл бұрын
@@honkinberry That explains it, I was trying out several things myself, like making a selection set or a list. But they didn't return values like those. I tried the entget and I got the same readout, thank you.
@YeYeBoyBoy
@YeYeBoyBoy 2 жыл бұрын
I am wondering, why is setting the 'dist' at the end where he is drawing the line. Am i missing something? it isnt really needed at that point or is it?
@honkinberry
@honkinberry 2 жыл бұрын
Correct, at about 55:00 that 'dist' is not used, it was just setting to a variable in case it needed to be used. But by using a Dimension there, it did make it unnecessary to worry about the distance. A classic need for the distance, would be to report the distance in more friendly units - for instance in Meters if the plan is drawn in Millimeters. And this way the variable is there and ready to be converted if necessary.
@christinewatts4111
@christinewatts4111 4 жыл бұрын
Thank you, how would I get a copy of the code or a download that you mention in the video? Is there an email?
@Landfx
@Landfx 4 жыл бұрын
The project files are available on the page for each Webinar from our website, www.landfx.com/videos/webinars/item/4863-intermediate-autolisp.html
@georgekhaba6436
@georgekhaba6436 2 жыл бұрын
hello there , (; error: no function definition: DXF ) why does the the lisp editor don't recognized dxf in the code ? i tried to compile it and repeatedly gave me this error
@honkinberry
@honkinberry 2 жыл бұрын
That is the helper function i mention: (defun DXF (x l) (cdr (assoc x l)))
@georgekhaba6436
@georgekhaba6436 2 жыл бұрын
@@honkinberry thank you sir i might forgot to put it in the code
@georgekhaba6436
@georgekhaba6436 2 жыл бұрын
@@honkinberry Command: XX-FINDCLOSEST Select object: Backtrace: [0.50] (VL-BT) [1.46] (XX:ERROR "bad argument type: numberp: nil") LAP+46 [2.40] (_call-err-hook # "bad argument type: numberp: nil") [3.34] (sys-error "bad argument type: numberp: nil") :ERROR-BREAK.29 "bad argument type: numberp: nil" [4.26] (SSNAME nil) [5.20] (C:XX-FINDCLOSEST) LAP+262 [6.15] (#) [7.12] (# "(C:XX-FINDCLOSEST)" T #) :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY) :ARQ-SUBR-CALLBACK.3 (nil 0) that is the back trace of my code any idea where is the problem .... ps : still dont recognized the dxf as function 😅
@honkinberry
@honkinberry 2 жыл бұрын
@@georgekhaba6436 What is that error text saying? It's expecting a number, but is getting nil. In the line, (ssname nil) Hence, the second variable you are sending to ssname is nil. Either mistyped, or not set to 0 before the loop.
@georgekhaba6436
@georgekhaba6436 2 жыл бұрын
@@honkinberry i checked everything but didn't see my error and when i prompt the code it give the same result entget nil type error could you please review what im doing wrong ps : i changed the dim command to a line command in hope to at least draw a line here is my code : ;----------------------------------------------- (defun xx:Error (st) (if (not (member st (list "Function cancelled" "quite / exit abort"))) (vl-bt) ); end if (princ) ); end error (defun DXF (x l) (cdr (assoc x l))) (defun c:xx-FINDCLOSEST (/ *error* esel source p0 bname tempss i ent px CLIST n) (setq *error* xx:Error) ;select a block, and find the closest (if (and ;select an entity (setq esel (entsel)) ;get the entity info (setq source (entget (car esel))) ;make sure its a block (= (dxf 0 source) "INSERT") ); end and ;grab its insertion point (setq p0 (dxf 10 source) ;grab its block name bname (dxf 2 source) ); end setq ; otherwise exit (exit) ); end if ;get all of that block (setq tempss (ssget "X" (list (cons 0 "INSERT") (cons 2 bname) );end list );end ssget i 0 );end setq ;porcess those blocks (while (and tempss (< i (sslength tempss))) (setq ent (entget (ssname tempss i))) (if (and (/= (dxf 5 ent) (dxf 5 source)) ; additional filter );end and ;calculate distance to start point (setq px (dxf 10 ent) dist (distance p0 px) CLIST (append CLIST (list (list dist px) ); end list );end append ); end setq ); end if (setq i (1- i)) );end wihle (print CLIST) ;sort that control list (setq CLIST (vl-sort CLIST (function (lambda (a1 a2) (< (car a1) (car a2)) );end lambda );end function ); end vl-sort );end setq ;do something with that list ; draw a line to closest ;draw a line to the X closest (repeat 5 ; to repeat the function 5 times (setq n (car CLIST) dist (car n) px (cadr n) ) ;end setq (command "line" p0 px "") (setq CLIST (cdr CLIST)) ); end repeat (princ) );end findclosest ;------------------------------------------------------------------------
Two Wire Technology for Irrigation Design
40:00
Land F/X
Рет қаралды 8 М.
AutoLISP Basics
1:02:29
Land F/X
Рет қаралды 52 М.
Happy 4th of July 😂
00:12
Pink Shirt Girl
Рет қаралды 61 МЛН
When You Get Ran Over By A Car...
00:15
Jojo Sim
Рет қаралды 28 МЛН
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
How to Control the Flow of AutoLISP Program
16:58
cyber CAD solutions
Рет қаралды 8 М.
AutoLISP & Dynamic Blocks - Part 1
33:20
Random CAD Stuff
Рет қаралды 9 М.
How to Select And Process Multiple Objects in AutoLISP Program
19:08
cyber CAD solutions
Рет қаралды 15 М.
Which dxf codes are required to Create a Line Circle And a Text in AutoLISP
26:51
What are Geometric Functions used in AutoLisp
16:57
cyber CAD solutions
Рет қаралды 11 М.
Cool Tech You’ll LOVE!
21:41
Snazzy Labs
Рет қаралды 31 М.
Learn Docker in 2 Hours - A Full Tutorial (2024)
2:09:28
KodeKloud
Рет қаралды 1 МЛН
Beyond the Basics   Macro Automation
59:22
AutoCAD
Рет қаралды 46 М.
How to write a AutoLISP Program to Create New Objects in AutoCAD
35:38
cyber CAD solutions
Рет қаралды 42 М.
Где флагманы с IPS?
0:52
Не шарю!
Рет қаралды 33 М.
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 13 МЛН
СТРАШНЫЙ ВИРУС НА МАКБУК
0:39
Кринжовый чел
Рет қаралды 932 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 21 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,2 МЛН