Author Topic: Together, but apart....  (Read 9648 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Together, but apart....
« Reply #15 on: March 30, 2004, 03:12:39 PM »
Well, I know this is not what you are looking for ... exactly ... but it should work ...
Create a command reactor ....
Here is what I would use for Pseudo Code...

[code]
begin command reactor
pickstyle set to 1 or 3 by default
grab current pickstyle setting
if begin command reactor reports "move" "copy" "trim" "extend" "mirror" etc ....
set pickstyle to 0

end command reactor
if end command reactor reports "move" "copy" "trim" "extend" "mirror" etc ....
set pickstyle to 1 or 3 (or previous setting)

Quote


It is now transparent, and you do not have to be running the original lisp to handle it.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Together, but apart....
« Reply #16 on: March 30, 2004, 04:23:38 PM »
Quote from: Water Bear
@Columbia, I don't think that I can leave them as selection sets because I will be creating 300+ sets (alot of duct pieces, air outlets etc...) and as I recall, there is a limit in Autocad for selection sets.

@Seven, I see how that works well for a variable and a value...but how can I use that to associate: say, a line, an arc, a piece number (text) and a text box? I need to be able to move the piece number, if there is another duct below and it's piece number overwrites the first one; However, if I delete the piece number, I want everything associated with that number to be gone?
Also these associations must remain intact from one drawing session to the next.


(I was thinking alot smaller then what you just said.)

Water bear, you are talking about one H U G E program! (the same program that i -along with every other autocad'er-  has been "wanting" to write for along time now.) but the theory is all the same.  Your steping into the OOP world now. If you really want something like this i sudgest you design your pants off before you slap down any code. (Im not trying to discourage you in any way man! If you realy want this, go for it! but im just saying that...) you need to design the program before you go about coding ANYTHING on something as "advanced" as this.  

But;
Command: (setq ent-list-1 (cons "ent1" (car (entsel))))
Select object: ("ent1" . <Entity name: 435de70>)

Command: (setq ent-list-2 (cons "ent2" (car (entsel))))
Select object: ("ent2" . <Entity name: 435de88>)

Command: (setq master-data-list (append (list ent-list-1 ent-list-2)))
(("ent1" . <Entity name: 435de70>) ("ent2" . <Entity name: 435de88>))
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Water Bear

  • Guest
Together, but apart....
« Reply #17 on: March 30, 2004, 04:26:51 PM »
OK..it looks as though everyone agrees..reactors  it is! Now where can I get some good info  (with examples) of how to use reactors? I tried that "gardenpath" tutorial, but I got lost midway through! :horror: And the Developers help menu really just gives you alot of command lists.. :shock:
any recommended sources?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Together, but apart....
« Reply #18 on: March 30, 2004, 04:39:48 PM »
Quote from: water bear
Also these associations must remain intact from one drawing session to the next.


Seems like you are talking about "Smart Entities".
Perhaps if you used ADT or in my case ArchT and draw the duct as short fat walls.
The program take care of the overhead & you just draw the objects on plan view,
give them a size & Height and the routine cleans up the intersections.
The amount of coding behind these smart objects is many man hours so you might be
money ahead buying some specialized software.
My 2 cents.

CAB
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.

Water Bear

  • Guest
Together, but apart....
« Reply #19 on: March 30, 2004, 08:23:14 PM »
Actually that was what cause me to take on this project. I've worked with all the major programs and found that they were unprofessional, from the sheetmetal point of view. You see I've work in the shop, in the field and in the drafting room. I know how to design and make duct. Those other programs allow you to draw pieces that either cannot be made or are not cost-effective. I guess it is because they are written by programmers who have no experience in the field. Take a look http://theswamp.org/lilly.pond/Water%20Bear/swampthing.gif this is the first drawing I did with what I've learned at the swamp. Everything was drawn by lisp routines and  I've gotten pretty far with it. I think it might be worth completing the project. :wink:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Together, but apart....
« Reply #20 on: March 30, 2004, 09:28:56 PM »
That looks very interesting, would love to get a look at the actual drawing.

Sounds like you are committed, that's what it takes to get a big job done.
Did not realize you were well on your way with this project.

Could you explain  more about the groups. What you need to do with them?
What components make up a group. How the objects in the group are created.
What would need to be edited in the group once created? Stuff like that.

Only if you have time & the inclination should you answer my query.

CAB
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.

Columbia

  • Guest
Together, but apart....
« Reply #21 on: March 31, 2004, 07:56:22 AM »
Water Bear,

There is a relatively quick and easy way you could go, that doesn't involve reactors, but is more limited than reactors.

In an early post, you said that you wanted the program to delete all entities that are related to a call out, if that call out was deleted.  Well, okay here's what you could do.  You could store the entity names as XDATA embedded into the callout entites.  And then what you could do is build a command called DUCT-DELETE or something like that, which would mine the XDATA, find the entites with the enames, check for their exsistence, and delete them.  Doing it this way would save you some major headaches when it comes to creating reactors, but in the same respect allowing you to simulate the behavior in some minor ways.

You follow what I'm saying?  The list would then be part of the drawing, and not slave to the drawing session.

Although on second thought, enames might not get you there, I don't remember if they're persistent in the drawing.  But I know with 2004 and up that Handles are so that might do it...

Anyway, there ya go.   I hope this helps you along a little...

Water Bear

  • Guest
Together, but apart....
« Reply #22 on: March 31, 2004, 08:31:16 AM »
Thanks for the input guys!
I'll try that xdata angle first...gone to the books,brb :P

Water Bear

  • Guest
Together, but apart....
« Reply #23 on: March 31, 2004, 09:01:07 AM »
This sounds like what I might be looking for, except it's VBA:
Quote
This example prompts the user to select objects from the drawing. The selected objects are placed into a selection set, and the specified xdata is attached to all objects in that selection set.

Sub Ch10_AttachXDataToSelectionSetObjects()
    ' Create the selection set
    Dim sset As Object
    Set sset = ThisDrawing.SelectionSets.Add("SS1")
   
    ' Prompt the user to select objects
    sset.SelectOnScreen
   
    ' Define the xdata
    Dim appName As String, xdataStr As String
    appName = "MY_APP"
    xdataStr = "This is some xdata"
    Dim xdataType(0 To 1) As Integer
    Dim xdata(0 To 1) As Variant
   
    ' Define the values for each array
    '1001 indicates the appName
    xdataType(0) = 1001
    xdata(0) = appName
    '1000 indicates a string value
    xdataType(1) = 1000
    xdata(1) = xdataStr
   
    ' Loop through all entities in the selection
    ' set and assign the xdata to each entity
    Dim ent As Object
    For Each ent In sset
        ent.SetXData xdataType, xdata
    Next ent
End Sub

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Together, but apart....
« Reply #24 on: March 31, 2004, 09:11:31 AM »
Quote from: Columbia
... save you some major headaches when it comes to creating reactors, but in the same respect allowing you to simulate the behavior in some minor ways.


Remember it is as simple as changing the pickstyle variable, you can do it with this simple VBA reactor.

Try this VBA Paste it in the VBA ThisDrawing code window.....
Code: [Select]

Dim CPICK As Integer

Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
 CPICK = ThisDrawing.GetVariable("Pickstyle")
 If (CommandName = "MOVE")  Then
  Select Case CPICK
   Case 1
    ThisDrawing.SetVariable "Pickstyle", 0
   Case 3
    ThisDrawing.SetVariable "Pickstyle", 2
  End Select
 End If
End Sub

Private Sub AcadDocument_EndCommand(ByVal CommandName As String)
 If (CommandName = "MOVE") Then
  ThisDrawing.SetVariable "Pickstyle", CPICK
 End If
End Sub


Quote from: Columbia
Although on second thought, enames might not get you there, I don't remember if they're persistent in the drawing.  But I know with 2004 and up that Handles are so that might do it...


Handles are persistent throughout the life of a drawing, unless you wblock the entire drawing. Handles are also reset on wblocked portions of the drawing.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Water Bear

  • Guest
Together, but apart....
« Reply #25 on: March 31, 2004, 10:31:26 AM »
Hey that works!  :shock:  thanx Keith!
Is there a command in lisp that will check the current command call?

JohnK

  • Administrator
  • Seagull
  • Posts: 10640
Together, but apart....
« Reply #26 on: March 31, 2004, 11:00:32 AM »
Quote from: Water Bear
Hey that works!  :shock:  thanx Keith!
Is there a command in lisp that will check the current command call?

Quote
Command: *Cancel*
Command: *Cancel*
Command: line
Specify first point: (getvar "cmdnames")
"LINE"
Invalid point.
Specify first point: *Cancel*
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org