i have an interesting situation which i am trying to wrap my brain around to see what the best approach might be. I have a block, for which, i need:
1. at two points, need to extract the northing-easting
2. on a third point (along an edge), need to check and make sure that it is at least 24" above the EG immediately below.
please see attached image. what is the best way to accomplish this? i researched and found out that I cannot use dynamic blocks for cogo points, was hoping to be able to so that i can at least extract the N-E for multiple locations from the same block. any help is deeply appreciated.
Followup - with pictures, and the files attached.
I used your block as a starting point and added cogo points. #1 is at the center/insertion point of the block. #2-3 are at the posts and 4-8 are along the edge. All of the components are joined into a Group, and copied to build rows and columns. Note - the array command doesn't work in this case; no idea why but the cogo points were erased when I used it.
Once the array of panel groups was complete I applied the surface elevations to the points and exported them all to csv. I then used Data Extraction to get the block data out to another csv file. My blocks don't have any attributes with individual identification, so I created dummy panel names in Excel.
I also used formulas in Excel to calculate the top of post elevation and to create names for the Panel & Post cogo points based on matching to the coordinate of the block.
There are several options at this point. You could add the calculated post height to the point description, erase all of the point in the dwg and re-import only the post points.
Steve
Please use the Accept as Solution or Kudo buttons when appropriate
More attachments.
Steve
Please use the Accept as Solution or Kudo buttons when appropriate
I would use a Corridor. Then you could get the points from the point codes and have the panel raise itself a min 24" above ground if needed automatically, instead of having to check for that clearance manually.
I didn't have your lisp for incrementing the panel numbers in the blocks, so I cheated a bit and created some dummy numbers in Excel. The only real difference between your method and mine is that you put the cogo points inside a block where I used a group instead.
Steve
Please use the Accept as Solution or Kudo buttons when appropriate
here it is below, i cannot take full credit for it, found one online that i manipulated to fit my needs. do't ask why i called it "alltogether" lol.
(defun c:alltogether (/ tagname addno ss en an ad ch) (setq tagname "PANELNUM") (or def_addno (setq def_addno 1)) (initget 6) (setq addno (getint (strcat "\nStarting Panel Number <" (itoa def_addno) ">: "))) (or addno (setq addno def_addno)) (and (setq ss (ssget '((0 . "INSERT")(66 . 1)))) (while (setq en (ssname ss 0)) (setq an (entnext en) ad (entget an) ch nil) (while (and (= "ATTRIB" (cdr (assoc 0 ad))) (not ch)) (and (= (strcase tagname) (strcase (cdr (assoc 2 ad)))) (setq ch T) (entmod (subst (cons 1 (strcat "PANEL " (itoa addno))) (assoc 1 ad) ad)) (setq addno (1+ addno))) (setq an (entnext an) ad (entget an))) (if ch (entupd en) (progn (redraw en 3) (alert "PANELNUM Tag Not Found In This Insert") (redraw en 1))) (ssdel en ss))) (setq def_addno addno) (prin1) (setq tagname "LPOST") (or def_addno (setq def_addno 1)) (initget 6) (setq addno (getint (strcat "\nStarting LPOST Number <" (itoa def_addno) ">: "))) (or addno (setq addno def_addno)) (and (setq ss (ssget '((0 . "INSERT")(66 . 1)))) (while (setq en (ssname ss 0)) (setq an (entnext en) ad (entget an) ch nil) (while (and (= "ATTRIB" (cdr (assoc 0 ad))) (not ch)) (and (= (strcase tagname) (strcase (cdr (assoc 2 ad)))) (setq ch T) (entmod (subst (cons 1 (strcat "LPOST " (itoa addno))) (assoc 1 ad) ad)) (setq addno (1+ addno))) (setq an (entnext an) ad (entget an))) (if ch (entupd en) (progn (redraw en 3) (alert "LPOST Tag Not Found In This Insert") (redraw en 1))) (ssdel en ss))) (setq def_addno addno) (prin1) (setq tagname "RPOST") (or def_addno (setq def_addno 1)) (initget 6) (setq addno (getint (strcat "\nStarting RPOST Number <" (itoa def_addno) ">: "))) (or addno (setq addno def_addno)) (and (setq ss (ssget '((0 . "INSERT")(66 . 1)))) (while (setq en (ssname ss 0)) (setq an (entnext en) ad (entget an) ch nil) (while (and (= "ATTRIB" (cdr (assoc 0 ad))) (not ch)) (and (= (strcase tagname) (strcase (cdr (assoc 2 ad)))) (setq ch T) (entmod (subst (cons 1 (strcat "RPOST " (itoa addno))) (assoc 1 ad) ad)) (setq addno (1+ addno))) (setq an (entnext an) ad (entget an))) (if ch (entupd en) (progn (redraw en 3) (alert "RPOST Tag Not Found In This Insert") (redraw en 1))) (ssdel en ss))) (setq def_addno addno) (prin1))
i noticed that after data extraction, the xls file comes out a little strange (see attached). i was trying to dataextract them in the order:
PANELNUM LPOST RPOST ELEV NORTH EAST
could not make it come out quite that way. ended up having the attribute names in the same line. the PANELNUM attribute lines up with the correct northing-easting, the N-E for LPOST is two rows up, and for RPOST is one row down. let me know if you are interested in test running it at your end, and i will upload the CAD file.
What is your ultimate goal for this problem?
Are you wanting just a list of 3d point data for the two posts for each panel?
Can't find what you're looking for? Ask the community or share your knowledge.