Author Topic: Dialog Boxs for Blocks  (Read 7508 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Dialog Boxs for Blocks
« Reply #15 on: July 13, 2005, 12:51:05 AM »
Is the slide library on your search path ??

ie. can the proggy find the .SLB file from CAB's install ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

PHX cadie

  • Water Moccasin
  • Posts: 1902
Dialog Boxs for Blocks
« Reply #16 on: July 13, 2005, 01:04:59 AM »
Yes. The path d:\greg\misc\lisp\imgmenu011205 is in the Support File Search Path
Acad 2013 and XM
Back when High Tech meant you had an adjustable triangle

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Dialog Boxs for Blocks
« Reply #17 on: July 13, 2005, 01:21:35 AM »
What happens if you take the nil and comment from this line in the test routine ??

sld-lib   nil ;"op-elec"

ie
sld-lib  "op-elec"

I haven't tried it, but from a quick reading of the code, I think if no .SLB is passed in, the routine looks for sld files
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

TJAM51

  • Guest
Dialog Boxs for Blocks
« Reply #18 on: July 13, 2005, 08:18:07 AM »
I am having the same problem.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dialog Boxs for Blocks
« Reply #19 on: July 13, 2005, 08:49:13 AM »
Kerry, thanks for the input...
You got it. :)
In the sample files, I sent a library file instead of individual slides & never updated the test.lsp
The code change as Kerry pointed out is:
Code: [Select]
 (setq slide_lst '("ESYM-001"      "ESYM-002"      "ESYM-003"      "ESYM-004"      "ESYM-005"      "ESYM-006"
                    "ESYM-007"      "ESYM-008"      "ESYM-009"      "ESYM-010"      "ESYM-011"      "ESYM-012"
                    "ESYM-013"      "ESYM-014"      "ESYM-015"      "ESYM-016"      "ESYM-017"      "ESYM-018"
                    "ESYM-019"      "ESYM-020"      "ESYM-021"      "ESYM-022"      "ESYM-023"      "ESYM-024"
                    "ESYM-025"      "ESYM-026"      "ESYM-027"      "ESYM-028"      "ESYM-02A"      "ESYM-030"
                   )
        sld-lib  "op-elec"  ;  <---<<<   HERE, because you have a library
  )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

TJAM51

  • Guest
Dialog Boxs for Blocks
« Reply #20 on: July 13, 2005, 08:59:30 AM »
If you wanted to bring the symbols into the drawing based on the dimscale, how could this BE ACCOMPLISHED?



tHANKS

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dialog Boxs for Blocks
« Reply #21 on: July 13, 2005, 09:14:40 AM »
Using this example:
Code: [Select]
(command "-insert" (strcat path picked) pause "" "" pause)
written another way
(command "-insert"
         (strcat path picked) ; block name
         pause                ; insertion point
         ""                   ; X scale factor
         ""                   ; Y scale factor
         pause                ; rotation angle
         )
Change to this
(command "-insert"
         (strcat path picked) ; block name
         pause                ; insertion point
         (getvar "DimScale")  ; X scale factor
         ""                   ; Y scale factor <use X scale factor>
         pause                ; rotation angle
         )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

TJAM51

  • Guest
Dialog Boxs for Blocks
« Reply #22 on: July 13, 2005, 09:17:45 AM »
As I understand it.......this code would be used in the Blkinsert.lsp and each block would have it's own code for insertion with dimscale?

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dialog Boxs for Blocks
« Reply #23 on: July 13, 2005, 09:26:22 AM »
There is no provisions for acquiring the scale needed for each block.
You would have to provide that by user input vis a PAUSE or via Lisp
in the form of a lookup table. If this information was in the block
as an attribute you could add code to acquire it.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

PHX cadie

  • Water Moccasin
  • Posts: 1902
Dialog Boxs for Blocks
« Reply #24 on: July 13, 2005, 09:33:52 AM »
CAB/Keith,
 Should I cut/paste CAB updated code to the the img_menu.lsp? or should Keiths codes be saved as a lsp?
Is defun the command for a lsp? (defun mocorosc, therfore type mocorosc to run that lisp?
Is it poss to have several libraries/catagories with your program? ie civil blocks, struct, elec, notes etc.?
Keep in mind I'm just a mosquito :)
Acad 2013 and XM
Back when High Tech meant you had an adjustable triangle

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dialog Boxs for Blocks
« Reply #25 on: July 13, 2005, 10:54:34 AM »
CAB/Keith, <--<<  you mean Kerry not Keith
Should I cut/paste CAB updated code to the the img_menu.lsp?   NO NO NO
Is defun the command for a lsp? it defines a function
In ACAD type VLIDE then click on help, click the INDEX tab, enter defun to see the help info.


(defun mocorosc, therefore type mocorosc to run that lisp? Well not exactly:
If the function is named (defun MyRoutine at the command line in acad you would type (MyRoutine)
If the function is named (defun c:MyRoutine at the command line in acad you would type MyRoutine
If the function is expecting arguments like  (defun MyRoutine (arg1 arg2 / local vars) you
would have to supply the arg1 ans arg2



Is it poss to have several libraries/categories with your program?  Yes, but I don't have the time
right now to walk you through it. My work load won't permit it. Perhaps someone else will help you
through the process, although this is a little complex for your first lisp project.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Dialog Boxs for Blocks
« Reply #26 on: July 13, 2005, 10:56:48 AM »
Here is the corrected code:
Code: [Select]
(defun c:test (/ slide_lst sld-lib picked path)
  (setq slide_lst '("ESYM-001"      "ESYM-002"      "ESYM-003"      "ESYM-004"      "ESYM-005"      "ESYM-006"
                    "ESYM-007"      "ESYM-008"      "ESYM-009"      "ESYM-010"      "ESYM-011"      "ESYM-012"
                    "ESYM-013"      "ESYM-014"      "ESYM-015"      "ESYM-016"      "ESYM-017"      "ESYM-018"
                    "ESYM-019"      "ESYM-020"      "ESYM-021"      "ESYM-022"      "ESYM-023"      "ESYM-024"
                    "ESYM-025"      "ESYM-026"      "ESYM-027"      "ESYM-028"      "ESYM-02A"      "ESYM-030"
                   )
        sld-lib  "op-elec" ; nil if no library file
  )
  ;;  set path to "" or nil if using acad search path
  ;(setq path "C:\\OPTI\\LIBRARY\\ELEC\\")
    (setq path "")

  (while
    (setq picked
           (dcl_img_menu sld-lib ; name of slide library
                         slide_lst ; list of slide names
                         path ; path to the slides
                         "-=<  Electrical Symbols >=-" ; Dialog Box Title
                         "[ Pick image to insert: ]" ; prompt on image box
                         3 ; number of rows    3
                         4 ; number of columns 4
                         7 ; image height
                         18; image width
                        )
    )

     (princ (strcat "\n" picked " slide selected."))
     (command "-insert" (strcat path picked) pause "" "" pause)
  )
  (princ "\n***  User Quit  ***")
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

PHX cadie

  • Water Moccasin
  • Posts: 1902
Dialog Boxs for Blocks
« Reply #27 on: July 13, 2005, 03:45:06 PM »
Sorry Kerry
No prob, by no means do I want to impose. All have been a great help!
As far as complex, its never been my luck to start easy :)
Acad 2013 and XM
Back when High Tech meant you had an adjustable triangle

adalea03

  • Guest
Re: Dialog Boxs for Blocks
« Reply #28 on: September 29, 2006, 12:03:05 AM »
I organize my blocks in directories, and then employ the DosLib "dwg-preview" function.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Dialog Boxs for Blocks
« Reply #29 on: September 29, 2006, 10:30:26 AM »
Is there a tutorail for setting up slides for inserting blocks. Since moving to Arizonia I've seen several companies that have thier blocks set up as a dialog box with slides that when you click on one of the slides that block will insert. My new boss has mentioned setting up each preview as a slide, then image manager to set up a dialog box, but my Cad book does not get in much depth with slides, creating dialog boxs or image manager. If it helps what I am after is very similiar to what "Blockman" looks like. I've had a few replies, but I'm not looking to spend $50-$100

I modified an older version of Hotblocks many years ago, you can download a newer version free from the link below.

;;; by Lintang Darudjati
;;; HotBlocks
;;; A block manager with INI style customization file and a dialog box performing collection-grouping,
;;; file path display, and slide previews as 'hot thumbnails'. Build your own dwg block library with it.
;;; And make them ready to be inserted easily anytime.
;;; http://www.geocities.com/RainForest/1073/download.html

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64