Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

properties of a entity plotstyle dificulty

6 REPLIES 6
Reply
Message 1 of 7
stijn
168 Views, 6 Replies

properties of a entity plotstyle dificulty

i wrote a little lisp routine to be able to draw a line with exact the same properties as a line that has been draw allready.By doing this i don't have to set my layer,color,lwt,ltype,plotstyle manual.
everything works aallright but i can't find out how to get the propertie for my PLOTSTYLE

example : a line with layer = wall color = yellow lwt = 0.5mm , ltype = dashed1 ,plotstyle= black035

i can get everything exept the plotstyle=black035
does somebody can solve this
my lisp added below


(defun c:test (/ pnt1 object lwt entplotstyle)

;keep the lwt settings
;bestaande instelling lwt bewaren
(setq lwt (getvar "lwdisplay"))
;request entity name and coordinates
;opvragen van entitie naam + coordinaten van het punt
(setq pnt1 (entsel "\ duid een punt aan"))
;filter entity name
;uitfilteren van de entiteit naam
(setq object (car pnt1))
;mae enitiy layer current
;layer entiteitnaam curent maken
(setvar "clayer" (cdr (assoc 8 (entget object))))
;make enity ltype current ltype
;ltype entiteitnaam curent maken
(command "celtype" (cdr (assoc 6 (entget object))))
;make entity coler current
;collor entiteitnaam curent maken
(command "cecolor" (cdr (assoc 62 (entget object))))
;make lweight by layer
;lweight bylayer maken
(command "lweight" "bylayer")
;plotstyle entiteitnaam curent maken
;make enity plotstyle current


(setq entplotsyle (cdr (assoc 390 (entget object))))

(command "line" )

(setq a (entget (car (entlast))))

(setq b (cdr (assoc 390 (entget a))))
(setq c (cons (car d) entgetplotstyle))

(entmod a)


;(setq inhoud (entget object))

;(setq inhoud (entget (cdr (assoc 330 (entget (cdr (assoc 390 (entget object))))))))
;(setq inhoud (entget (cdr (assoc 390 (entget object)))))

;(setq inhoud (entget (cdr (assoc 330 (entget object)))))

;(setq inhoud (entget (cdr (assoc 350 (entget (cdr (assoc 330 (entget object))))))))


;(command "plotstyle"
; "c"
; (cdr (assoc 380 (entget object)))
; ""
; )
;lwt terug instellen zoals bij de start
;(command "lwdisplay" lwt)


)
6 REPLIES 6
Message 2 of 7
stijn
in reply to: stijn

sorry previous msg messed up

I wrote a little lisp routine to be able to draw a line with exact the same properties as a line that has been draw allready.By doing this i don't have to set my layer,color,lwt,ltype,plotstyle manual. everything works aallright but i can't find out how to get the propertie for my PLOTSTYLE example : a line with layer = wall color = yellow lwt = 0.5mm , ltype = dashed1 ,plotstyle= black035 i can get everything exept the plotstyle=black035 does somebody can solve this
Message 3 of 7
Anonymous
in reply to: stijn

Plot styles need to be applied to an object at least once to be available
for (entmake/mod). However, your code looks like it is (entmod)'ing using
the original entity data list, and not a modified one.


--
R. Robert Bell, MCSE
www.AcadX.com


"stijn" wrote in message
news:f15a2eb.0@WebX.maYIadrTaRb...
| sorry previous msg messed up
| I wrote a little lisp routine to be able to draw a line with exact the
same properties as a line that has been draw allready.By doing this i don't
have to set my layer,color,lwt,ltype,plotstyle manual. everything works
aallright but i can't find out how to get the propertie for my PLOTSTYLE
example : a line with layer = wall color = yellow lwt = 0.5mm , ltype =
dashed1 ,plotstyle= black035 i can get everything exept the
plotstyle=black035 does somebody can solve this
|
Message 4 of 7
stijn
in reply to: stijn

this is what the code does :

it asks to select a object.it looks at the objects entitys and it sets the entitys exactly like those of the object you selectes.
those works for all the entitys except for the plotstyle
Message 5 of 7
Anonymous
in reply to: stijn

Try this:

(defun C:Match (/ objPattern objModify)
(and
(setq objPattern (car (entsel "\nSelect pattern object: ")))
(setq objModify (car (entsel "\nSelect object to modify: ")))
(setq objPattern (vlax-EName->vla-Object objPattern))
(setq objModify (vlax-EName->vla-Object objModify))
(progn
(vla-Put-Layer objModify (vla-Get-Layer objPattern))
(vla-Put-Color objModify (vla-Get-Color objPattern))
(vla-Put-Lineweight objModify (vla-Get-Lineweight objPattern))
(vla-Put-Linetype objModify (vla-Get-Linetype objPattern))
(vla-Put-PlotStyleName objModify (vla-Get-PlotStyleName objPattern))))
(princ))


--
R. Robert Bell, MCSE
www.AcadX.com


"stijn" wrote in message
news:f15a2eb.2@WebX.maYIadrTaRb...
| this is what the code does :
| it asks to select a object.it looks at the objects entitys and it sets the
entitys exactly like those of the object you selectes.
| those works for all the entitys except for the plotstyle
|
Message 6 of 7
stijn
in reply to: stijn

thank you verry much.
it's working perfectly .now a little modification to implement it.

i really have to convince my boss to invest time in vba
Message 7 of 7
Anonymous
in reply to: stijn

Glad to help.


--
R. Robert Bell, MCSE
www.AcadX.com


"stijn" wrote in message
news:f15a2eb.4@WebX.maYIadrTaRb...
| thank you verry much.
| it's working perfectly .now a little modification to implement it.
| really have to convince my boss to invest time in vba
|

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost