Help To Block attribute pipe60.lsp !
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Help To Block attribute pipe60.lsp !

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Clive356323



Joined: 07 Dec 2006
Posts: 2

Posted: Thu Dec 07, 2006 2:06 pm    Post subject: Help To Block attribute pipe60.lsp ! Reply with quote

Hi
I have lsp (lisp) program below that creates a cylinder from point to point which works fine.
I would like to create a block from this and attribute it with:

Description - 2" Pipe
Size - (The length of cylinder P1 to P2)
Size DN - 50

I would then be able to extract these attributes to access and use them for parts lists, ordering etc.

Looked in lots of places for a solution but not sure what I am looking at.

Any help would be very appreciated.

Thanks

Clive


(defun C:PIPE60 (/ end sset)

; dia diameter of pipe mm
; start start point of circle
; end end of path for extrustion

; Store and set system variables

setvar "CMDECHO" 0

(Command (setq pt1 (getpoint "\nStart point")))

(Command (setq pt2 (getpoint "\nEnd point")))

(Command (setvar "useri5" 60))

(Command (command "cylinder" pt1 "D" (getvar "useri5") "c" pt2))

(princ)

)

Back to top
View user's profile Send private message
CarlB



Joined: 27 Sep 2005
Posts: 52

Posted: Fri Dec 08, 2006 2:09 am    Post subject: Reply with quote

I have to think there's a better way to do this. Seems like a lot of hoops to jump through to allow information extraction. Creating a block will be difficult -give it a different name for each insert? Then create & fill in attributes? Would it work if the routine inserted a separate block with just the attributes, then you could pre-make this block, and have the routine enter it each time pipe is drawn. And why use description in dual units, 2" & DN 50?.
Back to top
View user's profile Send private message
Clive356323



Joined: 07 Dec 2006
Posts: 2

Posted: Fri Dec 08, 2006 9:05 am    Post subject: Answer Reply with quote

Hi thanks for your reply,
I was thinking of always keeping the Block Name the same for each cylinder not redefining the others when it was created.

The only attribute that would need to change would be the Size = length of Cylinder P1 to P2.
Reason for the dual units is that when we sort the parts in access we use
Description = 2" Pipe
when we sort the items by size we use
Size DN = 50 (this works for all size eg 2-1/2")

The extraction to access also works by Handle and if the Block is removed it will be marked as deleted in the database and can be removed from the order / parts list.
I just thought it would be easier if the item was one.

Clive

Back to top
View user's profile Send private message
CarlB



Joined: 27 Sep 2005
Posts: 52

Posted: Fri Dec 08, 2006 4:45 pm    Post subject: Reply with quote

To have al "DN50" blocks have the same name you need to make a block with that name, give it the attributes you want. It could be a cylinder, diam=60, length =1. The routine would enter this and scale its length based on the pick points. Figuring how to set the UCS for insertion may be a little tricky. Attributes could then be entered. Invisible? (or they would be at some odd angle aligned with pipe).
Back to top
View user's profile Send private message
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB