• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

create a distinct automatically (dynamic devices)

  • Thread starter Thread starter Dr.Lube
  • Start date Start date

Dr.Lube

Guest
Hello again,
I would need an address on how to create an automatic distinction of the objects I have in the drawing.

This is the distinct of the cords, which in my dwg are blocks with name, length, width. in the distinct will also appear the type of upper and lower iron with relative disengagement (it is here the problem!!)

in my lisp I will go to make a general dump that matches the lengths of all the blocks with the same label that identifies the type (e.g. c1, c2, etc.).

notice this information and that related to how it is armed below and above I will go to insert this dynamic block with the edited attributes automatically. for each cord will go to generate the properly modified block immediately under the previous one.

My problem is that I have no idea how to design the upper and lower currents automatically (I tried with a "series", but I can't control the step of this parameter externally. Maybe I miss something. .

in the annex you find the block "distinta_cordoli".View attachment distinta_cordoli.dwgresult I would like to get:2015-04-09 16_15_38-Autodesk AutoCAD 2015 - [distinta cordoli.dwg].webpThank you so much!!
dennis

ps. some writings have not yet been converted as parameters
 
I finally made them with an entmake, after entering the block. .
I was wondering how to put the retino in automatic but I can't via lisp (just to change)

At the moment I was trying with:
Code:
(vl-cmdf "_-hatch" "p" "s" "col" (rtos color_sup 2 0) point_insertion "")
iterated for each iron (maybe it would make more sense to do otherwise)

I also wonder if there is a way to see the options in English instead of in Italian so as to put the right options instead of guessing2015-04-14 11_17_02-.webp

grazie, dennis
 
Okay, maybe I did it with the stupid method:
Code:
(vl-cmdf "_-hatch" "p" "s" "s" (entlast) "" "col" (rtos colore_sup 2 0) punto_inserimento "")
How can I do that in English?
ideas for a faster method?
 
for the command options you can consult online a guide in English, it will be trivial but that's what I did after I got tired of "trying".

the method with vla-addhatch should be the fastest after entmake.

you do not want to enter directly into the block already handled irons and set the relative visibility parameter when entering via lisp?
 
hi gp, I had seen vla-addhatch but I didn't understand the syntax.. I thought it was a little messed up, do you have any idea how it works?

the problem of my ferries is that there are "infinite" cases. depend on the width, the number (then the step), the type (then also changes the color of the needles that can be different from those below).

Oh, my God.[video=youtube;0jXQj9iDjy4]https://www.youtube.com/watch?v=0jxqj9idjy4&feature=youtu.be[/video]
 
I don't know how beautiful it is but I did this:
Code:
(defun hatch (colore / hobj)

      (setq acdoc (vla-get-activedocument  (vlax-get-acad-object))
          acspc (vlax-get-property acdoc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
    )

    (setq hobj (vla-addhatch acspc achatchpatterntypepredefined "solid" :vlax-true achatchobject))
    (vlax-put-property hobj 'color colore)

;aggiungo contorno -> accetta solo variant
    (vla-appendouterloop hobj
        (vlax-make-variant
            (vlax-safearray-fill
                (vlax-make-safearray vlax-vbobject '(0 . 0))
                (list (vlax-ename->vla-object ent))
            )
        )
                         
    )


  (vla-evaluate hobj)
  )
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top