Author Topic: wrong 3d polyline point  (Read 1397 times)

0 Members and 1 Guest are viewing this topic.

ssbp

  • Guest
wrong 3d polyline point
« on: March 20, 2016, 08:20:02 AM »
I have prepared some code in a simple way to extrude object. I could not see anything wrong in program but when I run it, it always went wrong way.
Program takes endpoint as a first point to draw a 3d polyline. Please help.

(defun c:cw ()
(setq getaxis (getstring "Please select plane :"))
(setq picker (getpoint "Please select endpoint of baseline :"))
(setq xpoint (car picker))
(setq ycdrpicker (cdr picker))
(setq ypoint (car ycdrpicker))
(setq zcdrpicker (cdr ycdrpicker))
(setq zpoint (car zcdrpicker))

(setq zxplus (+ xpoint 0.5))
(setq zxminus (- xpoint 0.5))
(setq zyplus (+ ypoint 0.5))
(setq zyminus (- ypoint 0.5))
(setq zzplus (+ zpoint 0.5))
(setq zzminus (- zpoint 0.5))

(setq yxplus (+ xpoint 0.5))
(setq yxminus (- xpoint 0.5))
(setq yyplus (+ ypoint 0.5))
(setq yyminus (- ypoint 0.5))
(setq yzplus (+ zpoint 0.5))
(setq yzminus (- zpoint 0.5))

(setq xxplus (+ xpoint 0.5))
(setq xxminus (- xpoint 0.5))
(setq xyplus (+ ypoint 0.5))
(setq xyminus (- ypoint 0.5))
(setq xzplus (+ zpoint 0.5))
(setq xzminus (- zpoint 0.5))

(if (= getaxis "z")
(progn
   (setq firstpoint (list zxminus zyminus zpoint))
   (setq secondpoint (list zxminus zyplus zpoint))
   (setq thirdpoint (list zxplus zyplus zpoint))
   (setq fourthpoint (list zxplus zyminus zpoint))
)
)

(if (= getaxis "y")
(progn
   (setq firstpoint (list yxplus ypoint yzplus))
   (setq secondpoint (list yxplus ypoint yzminus))
   (setq thirdpoint (list yxminus ypoint yzminus))
   (setq fourthpoint (list yxminus ypoint yzplus))
)
)

(if (= getaxis "x")
(progn
   (setq firstpoint (list xpoint xyplus xzplus))
   (setq secondpoint (list xpoint xyplus xzminus))
   (setq thirdpoint (list xpoint xyminus xzminus))
   (setq fourthpoint (list xpoint xyminus xzplus))
)
)

(command "3dpoly" firstpoint secondpoint thirdpoint fourthpoint firstpoint "")
(command "extrude" pause "" "path" pause)
(command "change" "last" "" "Properties" "LAyer" "335" "")
)



roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: wrong 3d polyline point
« Reply #1 on: March 20, 2016, 04:42:32 PM »
Most likely the problem is cause by the use of (command ...) in combination with your OSMODE setting.
Try:
Code: [Select]
(command "3dpoly" "_non" firstpoint "_non" secondpoint ...)Why don't you use the "_close" option?

ssbp

  • Guest
Re: wrong 3d polyline point
« Reply #2 on: March 21, 2016, 11:19:44 AM »
Yes! It works. Used "close". What is "_non"? I could not find it in 3dpoly command.

Thanks Roy.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: wrong 3d polyline point
« Reply #3 on: March 21, 2016, 12:30:48 PM »
"_non" means 'Do not use osnaps for the next point', so it is not a command option.
See: http://docs.autodesk.com/ACD/2011/ENU/filesACR/WS1a9193826455f5ffa23ce210c4a30acaf-4945.htm#WSc30cd3d5faa8f6d813d93f4ffc2d61250-7f6a

ssbp

  • Guest
Re: wrong 3d polyline point
« Reply #4 on: March 21, 2016, 01:14:55 PM »
Oh! Thanks Roy. I wasn't aware of this.